Confused with using Fourier Transform Properties

Your first approach doesn't work because the original signal is simply not the integral of the signal you sketched below it. Just graphically integrate that signal to see this. Your second approach doesn't work for the very same reason. If you integrate the rectangular signal  you don't get a signal that is zero for $t>1$. The value of the integral would remain at its final value and wouldn't change anymore because the original signal doesn't change for $t>1$.
That exercise can be solved in several ways, and you should try them all to get some practice. First, just compute the Fourier integral without trying any smart tricks. The signal is simple enough for this to be a good option, even if just as a reference.
Second, convince yourself that if $X(j\omega)$ is the Fourier transform of $x(t)$, then $jX'(j\omega)$ is the Fourier transform of $tx(t)$, where  $X'(j\omega)$ is the derivative of $X(j\omega)$ with respect to $\omega$. Since the signal is defined as $t$ times some other signal (whose Fourier transform is very basic), using the above-mentioned property is quite obvious.
A third approach could be to define a signal $x_1(t)$ which satisfies
$$x(t)=\int_{-\infty}^tx_1(\tau)d\tau$$
Then compute the Fourier transform of $x_1(t)$ and use the integration property of the Fourier transform to derive $X(j\omega)$. This is what you actually tried to do, but your definition of $x_1(t)$ was wrong. As a hint, note that for the correct definition of $x_1(t)$ you need two Dirac delta impulses.
Obviously, if you do things right, all three results should agree.


Why are some LDPC codes more immune to noise than others?

As you mention, the LDPC code is completely determined by its generator matrix H. Hence, the properties of H define the (theoretic) performance of the code.

Since the LDPC code is a linear code, the ultimate measure for the (theoretic) code performance is its minimum distance between two codewords, that is:

$$
d = \min_{c_1,c_2\in\mathcal{C}}\|c_1-c_2\|_0
$$

where $\mathcal{C}$ is the set of existing codewords (i.e. bit patterns that fulfill the parity check) and $\|\ldots\|_0$ denotes the hamming distance. This is equal to the expression (since it's a linear code)

$$
d = \min_{c\in\mathcal{C}}\|c\|_0
$$

where $\|\|_0$ is the Hamming weight.

I wrote the word "theoretically" in parenthesis, since the finally obtained performance does also depend on the decoding algorithm. Due to the low-density of the parity check nodes, the LDPC is suitable for iterative decoding, which can yield big gains.

Another improtant measure is the length of the shortest cycle of the LDPC Tanner Graph. The shorter the cycle, the worse is the performance of the iterative decoding.


Does a collection of Gaussian random variables necessarily constitute a Gaussian Process?

As you correctly say, if $\{X(t)\colon t \in \mathbb T\}$ is a Gaussian process, then for every possible choice of $n$ random variables $X(t_1), X(t_2), \ldots, X(t_n),$ where $t_k \in \mathbb T$ for $ k = 1,2,\ldots, n$, the $n$ variables are jointly Gaussian. Indeed, that is the definition of a Gaussian random process: a collection of random variables such that every finite subset of random variables is jointly Gaussian, that is, has a multivariate normal density.  Note that the individual random variables are also themselves Gaussian random variables.  Note also that the definition does not require that the index set $\mathbb T$ be a countable set such as $\mathbb Z$, the set to all integers (which would make the process a discrete-time process); having $\mathbb T = \mathbb R$, the set of real numbers, is fine (this makes the process a continuous-time process): but in either case,the requirement is still the same that every finite subset of random variables that you can choose from the process has a jointly Gaussian distribution. There is no such thing as an infinite-dimensional joint distribution function (joint Gaussian or otherwise), and so the definition is silent about what can be said about the joint distribution of infinite subsets of the random variables.

You are asking whether it is true that if we have

  a collection of Gaussian random variables, specifically the set $\{X(t)\colon t \in \mathbb T\}$, such that each member $X(t)$ of the set is a Gaussian random variable,

then

  is it always the case that the set constitutes a Gaussian process?

The answer is No if you accept the definition above because Gaussian random variables don't have to be jointly Gaussian, and is so there is no guarantee that the chosen collection of Gaussian random variables is also a collection of jointly Gaussian random variables, as required in the definition of Gaussian random process.  An incredibly diverse collection of joint densities of two Gaussian random variables that are not jointly Gaussian can be found in this answer on stats.SE.

Turning to your "micro phenomenon" comment, it seems that you are (or the author of your textbook is) thinking that the assumption of individual Gaussianity is justified from a central limit theorem type view of the distribution of each individual random variable.  This is not quite correct. The Gaussian random variable model usually comes from an assumption that one  is dealing with thermal noise which is caused by the random motion of electrons inside a conductor. The (small) charge on each electron induces a (small) voltage across the terminals of the conductor depending on the position of the electron with respect to the terminals, and all the zillions of such voltages add up (or cancel out) to produce a net voltage  which can be modeled a Gaussian random variable. This net voltage varies with time as the electrons jostle about, creating a random process that is generally modeled as a Gaussian process, that is, we make a leap of faith that the random variables are not just individually Gaussian (which we can justify as above in a hand-waving sort of way) but also jointly Gaussian. One justification for this leap of faith is that if we imagine a linear system with white Gaussian noise as input, then the output process is a Gaussian process. More important, the linear system with white Gaussian noise input model has considerable support from experimental evidence it matches up well with physical reality.

@AlexTP Uncorrelated Gaussian random variables are not necessarily jointly Gaussian random variables. The classic example is $X \sim N(0,1), Y = ZX$ where $Z$ takes on values $\pm 1$ with equal probability $\frac 12$. Then, $Y \sim N(0,1)$ also. Furthermore, $X$ and $Y$ are uncorrelated random variables, but $X$ and $Y$ are not jointly Gaussian random variables. In fact, all the probability mass lies along two straight lines intersecting at right angles instead of being distributed with circular symmetry in the plane as happens with jointly Gaussian random variables with equal variances.


Confusion with ADC conversion in MCP3424

If the conversion is 18-bit, there will be 262144 levels.

However, it seems to me that on the ADC Pi board, one of the differential inputs of each MCP3424 converter channel is grounded ; so this actually halve the range, and the first bit of a word read from the ADC will always be zero. That's why the ADC Pi datasheet reports half the resolutions compared to those published on the MCP3424 datasheet (17-bit, 15-bit, 13-bit, 11-bit).

There is a relationship between data rate and bit rate because the converter has a delta-sigma architecture. There is an internal conversion/integration clocked at a fixed 983040 Hz, and this conversion "budget" can be used at your whim to achieve different data rate / bit-rate ratios with:

$$s_r = \frac{983040}{2^{b_r}}$$

Intuitively (and this is a gross mis-simplification), reducing the sample rate gives the ADC more time to extract the finer details of each sample.


Can I use IIR or FIR to get a sliding mean?

It corresponds to an exponentially weighted moving average (EWMA) filter with parameter $\alpha = 0.01$.

The difference equation can be expressed as:

$$y(n)-(1-\alpha)y(n-1)=\alpha x(n)$$
$$y(n)-0.99y(n-1)=0.01 x(n)$$

Thus it's an IIR filter. You can easily get the coefficients from the difference equation.

$$Y(z)-0.99z^{-1}Y(z)=0.01X(z)$$
$$\frac{Y(z)}{X(z)}=\frac{0.01}{1-0.99z^{-1}}$$

Therefore, a = [1 ; -0.99] and b = 0.01.


Resolving two nanosecond pulses with filter

The problem is that your low-pass IIR filter matches the original filter's magnitude response but will definitely not match its phase response.

The IIR filter will have a kernel that is larger closer to $t=0$ than your plotted filter kernel.  This means that, even if the magnitude frequency response matches, the phase frequency response will not be similar.

So you have the filter's impulse response, which is sort of like a long FIR filter.

Unfortunately, designing an analog filter that matches this response is a little tricky. Most techniques for designing such filters assume you don't care about the phase response.

One way might be to take your FIR current filter and perform model order reduction on it. See, for example, matlab's balred method that does balanced truncation (I think), though you may need to do some discrete-to-continuous or vice-versa transformation to get things to work.


Remove spurious peaks of Hilbert transform

As far as I understand, you have a periodic signal, or a quasi periodic signal. And as far as I understand, you have lots of false positives when you detect the peaks.

You need a better way to identify peaks, try this  one...


What Makes a Signal Processing Book Good or Less Good?

So I'll just name one good book and why.

LINEAR ESTIMATION T.Kailath, A. H. Sayed, and B. Hassibi

The subjects are explained in a clear and insightful way. One feels that they understand when you get to end of the chapter

Then we try the problems and stare at them in blank confusion. Very little is obvious. We now know we don't understand anything.  There is little that a web search will clarify. The problems only yield after thinking and thinking hard.


[Given figures are from A new improved Kurtogram and its application to planetary gearbox degradation feature analysis, Xianglong Ni et al.]
This $k$ in the graph (and the $K$  in the Table) corresponds to an equivalent "dyadic-power", providing the number of subsequences at each level, alternating dyadic splits with filters on subbands $[0,1/4]/[1/4,1/2]$ and $[0,1/6]/[1/6,1/3]/[1/3,1/2]$.   The number of such subsequences in the 1/3-binary tree are $2,3,4,6,8,12\ldots$, approximately $2^1,2^{1.6},2^{2},2^{2.6},2^3,2^{3.6}\ldots$, since $\log(2)/\log(3)\sim 0.6$.
Additional sources:

Calcul Rapide du Kurtogramme et Applications, Jérôme Antoni (short, in french)
Fast computation of the kurtogram for the detection of transient faults, Mechanical Systems and Signal Processing, 2007

I unfortunately cannot help totally on the interpretation of this particular paper. I remember that the original  spectral kurtogram was meant to detect, localize or characterize nonstationarities from signals. The kurtogram was a fast version, reusing principles from wavelet packets and multiband filter banks and quasi-analytic filters.  When looking at maximum values in a kurtogram, if they are concentrated, one may suspect non-stationary components in a noisy signal. Then, it is possible to extract or invert the aforementioned component to check or denoise the original data.
I would suggest you to read several papers, especially the early ones, showing interpretations of different kurtograms.


What is "feature indexing" in image processing?

The idea is that each image generates a series of features, and you want to be able to search all images based on these features.  That way, features in one image can be quickly associated with close features in another image.

For example, this slide deck has decided to use four "visual words" to say that each block of images in the figure are "the same" in some sense.

I'm not quite sure what you mean by:

  we assign a number to each row/column of our feature vectors

Each figure vector is a series of numbers.  What that slide deck does is assigns an identifier (visual word) to each block of similar images (features).

What indexing then does is finds the "middle" of each visual word (group of similar figures) so that other images can be indexed against these words. The green dots in the left-hand of the diagram are the middles for three of the words.


How to prove these two definitions of the minimum phase transfer function are same?

To your second definition it should be added that you only consider causal transfer functions, because it is not difficult to find a smaller phase lag with a non-causal system:

  A minimum-phase system is a causal and stable system with a phase lag that is smaller than the phase lag of any other causal and stable system with the same magnitude response.

Note that a real-valued zero in the left half-plane contributes a phase change of $\pi/2$ to the total phase as we move along the frequency axis from $\omega=0$ to $\omega\rightarrow\infty$:

$$0\le\arg\{j\omega+a\}<\frac{\pi}{2},\qquad a>0,\quad\omega\in[0,\infty)\tag{1}$$

A complex conjugate pair of zeros contribute a phase change of $\pi$.

On the other hand, a real-valued zero in the right half-plane contributes a phase change of $-\pi/2$ as $\omega$ moves from zero to infinity:

$$-\frac{\pi}{2}<\arg\{a-j\omega\}\le 0,\qquad a>0,\quad\omega\in[0,\infty)\tag{2}$$

Note that I've chosen the sign of the term $s\pm a$ such that in both cases the phase is zero for $\omega=0$, which is necessary for a fair comparison between the two cases.

Consequently, exchanging a zero in the left half-plane for a zero in the right half-plane (without changing the magnitude of the frequency response) will always result in an additional phase lag of $\pi$ for $\omega\rightarrow\infty$.

As an example, consider two first-order transfer functions:

$$H_1(s)=\frac{s+2}{s+1}\quad\text{and}\quad H_2(s)=\frac{2-s}{s+1}\tag{3}$$

The signs of $H_1(s)$ and $H_2(s)$ were chosen such that their phases are both zero for $s=0$ (and not $\pm\pi$). The figure below shows the phase plots ($\arg\{H_1(j\omega)\}$ in blue, and $\arg\{H_2(j\omega)\}$ in green):

The pole contributes a phase change of $-\pi/2$ as $\omega$ moves from zero to infinity. The left half-plane zero of $H_1(s)$ contributes a phase change of $\pi/2$, resulting in a net phase change of zero, whereas the right half-plane zero of $H_2(s)$ contributes a phase change of $-\pi/2$, resulting in a total phase change of $-\pi$.

Another way to see the same thing is to note that any causal and stable transfer function can be written as the product of the minimum-phase transfer function with the same magnitude and a causal and stable allpass:

$$H(s)=H_m(s)H_a(s)\tag{4}$$

It can be shown that the phase of a causal and stable allpass is always non-positive for $\omega\in[0,\infty)$, and, consequently, the phase lag of the minimum-phase system is always less than or equal to the phase lag of any other causal and stable system with the same magnitude response.


Why can we know the best precoding direction after we do the SVD to the channel?

First you have to know that the vector in $U$ and the vector in $V$ are orthonomal,that is ,$\vec u \vec u^H=I$,and $\vec v \vec v^H=I$.

So now $H=U\Sigma  V^H$,and $y=Hs+n=(U\Sigma  V^H)s+n$

and $U^H y=\Sigma  V^Hs+n$,see the $\Sigma  V^Hs$,isn't it like " channel gain $\times$ beamforming $\times$ signal $s$ "?

Now you can also find that according to the rule of multiplication of matrix,the first element of $\Sigma$,which is the $\sigma_1$,will multiple every element of $v_1^H$,that is why we say the $v^H_1$ is the best precoding ,because its elements will multiply the biggest singular value ,$\sigma_1$, every time.


Fundemental scintific publication in up conversion down conversion

Certain Topics in Telegraph Transmission Theory by Nyquist (1928) might be what you're looking for (emphasis mine):

  The following topics are discussed:

  The required frequency band is directly proportional to the signaling speed.
  A repeated telegraph signal (of any length) may be considered as being made up of sinusoidal components. When the amplitude and phase,
  or real and imaginary parts, of these components are plotted as
  ordinates with their frequencies as abscissas, and when the frequency
  axis is divided into parts each being a frequency band of width
  numerically equal to the speed of signaling, it is found that the
  information conveyed in any band is substantially identical with that
  conveyed in any other; and the bands may be said to be mutually
  redundant.
  The minimum band width required for unambiguous interpretation is substantially equal, numerically, to the speed of signaling and is
  substantially independent of the number of current values employed.
  A criterion of perfect transmission is selected; and a discussion is given of the characteristics which the received wave must have to
  be nondistorting with the requirement that the frequency range should
  not be greater than necessary.
  Directions are sketched for specifying systems to meet this requirement.
  Several alternative criteria of distortionless transmission are considered and a method for computing the corresponding transmission
  characteristics of the circuit is explained and illustrated.
  An analysis is given of the carrier wave, and it is shown that the usual carrier telegraph requires twice as much frequency range as the
  corresponding d-c. telegraph, other things being equal.
  A discussion is given of two alternative methods for overcoming this inefficiency of carrier telegraphy, namely, the use of phase
  discrimination and of a single sideband.
  After the d-c. and carrier waves have thus been analyzed a corresponding analysis is given of an arbitrary wave shape, including
  these two as special cases. Calculations are given on the shaping of
  the transmitted wave so as to make the received wave perfect.
  A discussion is given of the dual aspect of the telegraph wave. The wave may be looked on either as a function of , requiring the
  so-called steady-state method of treatment, or as a function of
  requiring the so-called method of transients. It is shown that the
  steady-state theory can be made to yield the information necessary to
  specify the characteristics of an ideal system.
  A discussion is given of the effect of interference and departures from ideal conditions.


A DCT is identical to a DFT, twice as long, of the input data concatenated with its mirror image.   Data concatenated with its mirror results in symmetric data.

Since a symmetric vector is strictly even, there are no odd (sine or imaginary) components in the DFT result. Just cosine (or real or even) components.  Thus you can reconstruct the original input without the all-zero imaginary component.  (In practice, there might be some numerical rounding noise).

Not so with a DFT of just the original data (not doubled and mirrored), which likely is not exactly symmetric (even).  Thus you need the full complex result of a DFT to reconstruct its input (unless it just happens to be perfectly circularly symmetric around the 1st vector element, x(0)).


In general, a kernel is a function that acts as a parameter to some algorithm.

Filtering: For example, it's possible to call the impulse response of a filter $h[n]$ a kernel, so that it is the parameter that defines the filter operation:
$$
y[n] = h[n] * x[n].
$$

The use of the term kernel in the filtering context is much more common in 2D filtering or image processing.  The link talks about the kernel being a matrix, but really it's just a sampling of the function that is the "true" kernel.

PDF Estimation: Kernel-based methods are often used in other contexts, too.  For example, when estimating the probability density function of a random variable, kernel-based estimators are often preferable to simple histogramming.  In that context, there are many different possible kernels.

Machine Learning: Finally, another context for kernel based algorithms is in machine learning.  Here, we are interested in classification of an input into one of (possibly) many classes.  Again, the kernel is a function $k(\mathbf{x}_i,\mathbf{x}')$ that parametrizes the algorithm and there are many possible selections.


The output of the distance transform depends on the applied vector norm (euclidean, maximum, manhattan, ...), see e.g. here or here.

From your example solution, I assume you take the Manhattan distance. Then, your result for the interior of the shape is correct. However, for the exterior of the region, why would it be zero? For the distance transform, the shape of the image does not count, it is only a pixel-based algorithm, where each pixel gets the value that matches its distance to the next non-zero pixel. Apply this to the outer pixels and you have the correct result.


Error analysis for uniform quantization of uniform input

This assumes that both quantization error and original signal are uniformly distributed and have zero mean.

That's a good assumption for quantization noise, but it feels very arbitrary for the signal.

The variance will be proportional to the power (not energy), ONLY if the signal is mean free. Power is defined roughly as the "mean of the squares"  and variance as the "mean of the squares after subtracting the signal mean".


Frequency response of discrete PT1 in MATLAB

Found the error by myself now.

I did not use the instantaneous frequency for the calculation of the sweep signal, as stated here or here.

The corrected code is:

clear

%% Input (linear frequency sweep)
Ts = .1e-3;
duration = 30;
t = (0:Ts:duration);
fs = 1/Ts;
f = (fs/2)*t/duration;
finst = 1/2*(fs/2)/duration*t;
u = sin(2*pi*finst.*t);

%% PT1-system continuous
T1 = 1e-3;
G = tf(1,[T1 1]);

%% PT1 discretized
H = c2d(G,Ts,'zoh');
x0 = 0;

%% PT1 trasient response
x = lsim(H,u,[],x0,'zoh');

%% PT1 freq. response
[h,~] = freqz(H.Numerator{1:end},H.Denominator{1:end},f,fs);

%% Plot
figure(1),clf(1),hold on
plot(u),plot(x),plot(abs(h))


It's actually a band-pass characteristic, since very low frequencies will be inaudible on headphones. Firstly, searching for "headphone frequency response" brings up a lot of results, especially on an image search. Then, the site headphone.com seems to offer frequency characteristic plots for many of the headphones they sell.

Unfortunately, you often only get graphs. However, you can use tools like g3data (plot digitizing tools) to assist you in recovering data from pictures or even scans of plots. I used such tools a lot to trace plots from scientific papers for which data is usually not available.


A window function $w(t)$ satisfies $w(t)\ge 0$. The value of a window's frequency response $W(f)$ at DC ($f=0$) equals its integral
$$W(0)=\int_{-\infty}^{\infty}w(t)dt>0\tag{1}$$
which is clearly greater than zero because $w(t)\ge 0$. For all other frequencies we obtain the following bound:
$$|W(f)|=\left|\int_{-\infty}^{\infty}w(t)e^{-j2\pi ft}dt\right|\le\int_{-\infty}^{\infty}\left|w(t)e^{-j2\pi ft}\right|dt=\int_{-\infty}^{\infty}w(t)dt=W(0)\tag{2}$$
Eq. $(2)$ means that $|W(f)|$ cannot be greater than its DC value. Actually, it can be shown that $(2)$ is a strict inequality for any $f\neq 0$: $|W(f)|<W(0)$ for any $f>0$. This shows that $W(f)$ has a lowpass characteristic.
To give a more intuitive explanation, a rectangular window's frequency response is a sinc function, which has a lowpass characteristic. All other windows are just smoother versions of a rectangular window, which means that their spectra decay faster than a sinc. I.e., non-rectangular windows have an even more pronounced low pass characteristic than a rectangular window.


Implementing digital filter by padding with zeros

Zero padding your input signal does not change your sampling frequency, it just changes (in this case probably very slightly) the time duration of your input signal.  An example would be that whether you filter one second's worth of data or two second's worth of data doesn't have any impact on the sampling frequency of the data.

One thing to keep in mind is that there will be a start up transient when zero-padding because your input signal instantaneously goes from zero to the value of the signal, essentially applying a step function on top of your signal of interest.  Generally speaking, you'll want to make sure you have some amount of data before a feature you're really interested in to make sure the start up effects have sufficient time to decay.  The website you mention gives the step response of the generated filter so you can check to see what effect it will have on your signal of interest.


After playing around in GNURadio, this waveform looks like 2 level ASK bursts (OOK bursts plus some residual carrier).

The carrier appears to be at 12.4 kHz.

At the 44.1 ksps sample rate, there appears to be about 7.6 samples/symbol or a symbol period of about 173.5 microseconds (assuming the symbols are not Manchester encoded).

See the top plot in the following image showing two filtered, rectified, and pulse filtered bursts.

Update to respond to comment

What I mean by 2-ASK with residual carrier is that, during a transmission, the original signal is probably something like:

$$(0.1 + 0.5q(t))\cos(2\pi 12400t)$$

where $q(t)$ is the train of unipolar message bit pulses.
With a square pulse matched filter in the receiver, one is going to get ISI, which you can see in the short (suspected) preamble of the bursts.

By the way, I have not checked the phase to see if the bursts are the real part of QPSK with a non-standard rotation (which would result in 4-QAM with constellation points only on the real axis), but that seems unlikely for a low parts count biometric headphone device.

The signal you provided was already low pass filtered with a corner at about 15-16kHz, indicating something was going to decimate this to a 32 ksps signal.

What I did in GNURadio is in the following flowgraph image:

I used the "Hilbert" block with a 201 tap Hilbert FIR filter to make the real signal analytic.  201 taps is obviously overkill, looking at the negative frequency side of the spectrum.

I then used a Blackman-Harris windowed high pass filter, with real taps, with a corner at 4 KHz, a transition width of 1 kHz, and an objective stop band attenuation of 20 dB.  This was to get rid of the mess near DC.  Some of the mess at DC was tracking with the signal, but some of it seemed unrelated.

I then took the envelope with the "Complex to Mag" block.

I then used a rectangular pulse matched filter with taps of $[1, 1, 1, 1, 1, 1, 1, 1]/8$ .  This introduces receiver side ISI, but reduces the noise.

I don't know how you captured this signal, but it would be better if you can do something on the analog side to improve the signal level or SNR, and also preserve the component that was likely at 18.6 kHz, since you're using a sample rate of 44.1 ksps.


I'm still not quite sure I understand what you're trying to achieve, but here's an example I cooked up in scilab.

The input is 33 points of a sine wave:

fs = 100; // 10kHz sampling rate
Tin = 1/fs; // Input sampling period
N = 16;
tin = [-N:N]; // Times of samples
f0 = 5;

x = sin(2*%pi*f0/fs*tin + 1.123791823)

clf
subplot(211)
plot(tin,x)

The sampling frequency is 100Hz, the frequency of the sine wave is 5 Hz.

Then, I try to interpolate this up to a sampling frequency of 700Hz using the sinc formula:

Tout = 1/700;
tout = -N:Tout:N;
y = zeros(1,length(tout))
for n = 1:length(tin)
    y =  y + x(n)*sinc(%pi*(tout-tin(n)))
end

plot(tout,y,'r:')
title('Input (blue line) and interpolated (red dotted line)')

subplot(212)
dx = splin(tin,x);
x_interp = interp(tout,tin,x,dx);
plot(tout,y-x_interp)
title('Error')

The results are as plotted below.


Making audio clips comparable in terms of RMS

I wrote this simple Matlab function a while back, it operates on dBFS:

function y = change_rms(x, newRMS)

    currentRMS = mean(20*log10(rms(x)));

    d = newRMS - currentRMS;
    y = x * 10^(d/20);
end

You would call a function like this with the signal whose RMS you want to change as the first argument (consecutive samples along the first dimension, channels along the second) and the new RMS value in dBFS as the second argument. After processing all signals so that they have an RMS equal to your reference RMS, you check which signal contains the highest absolute value. Then devide all signals by that value. They will then all have the same RMS (i.e. mean RMS) and their internal level ratio between channels will still be what it was before changing their RMS.

Note however that the final RMS that all signals will have after this procedure will not be equal to the reference RMS you used when calling the function. This is of course due to dividing all signals by the maximum absolute value of the entire data set after using the function. Consequently, the final RMS will be determined by the signal that contained the maximum absolute value across the entire data set.

Here is the step-by-step guide:

Process all your audio files with the script provided above. Use the
same newRMS for all the audio files. newRMS can be an arbitrary
value.
Find the highest absolute value in the entire set of audio files.
Divide all audio files by that value.

After that, all audio files will have the same RMS. All audio files will have values in the [-1 1] range.


The Wikipedia article on "distortion" is actually pretty good. https://en.wikipedia.org/wiki/Distortion

Partially it's about semantics and how you exactly define the term. By most definition "linear distortion" is used equivalent to "non ideal frequency response" where magnitude and/or phase are a non-trivial function of frequency.

Non-linear distortion is caused by any type of mechanism that violates linearity. Typical examples are limiting or clipping or compression.

An LTI does not cause any type of non-linear distortion, however they typically do cause linear distortion if defined as "non-flat frequency response"


Ok, to get this straight: you're doing DBPSK, but you're still seeing a constant phase error that has a non-zero mean?

That means you've got a frequency error.

Your assumption

  We suppose the Doppler shift is perfectly compensated

hence must be wrong.

So, correct frequency instead of the phase. You're already using DBPSK because you don't want to correct the absolute phase (I hope this was known to you. If you didn't know why you did differential modulation: please go and read up on differential phase shift keying, and why you don't use a phase-correcting loop with D(B)PSK).


Coherence vs. Magnitude Squared Coherence

I believe that the calculation of the magnitude squared coherence is faster for computers (multiplication is faster than square root calculations). And that's pretty much it. :P


Extracting Binary Magnetic-Strip Card Data from raw WAV

This is called biphase mark code, and you have to focus on the zero-crossings instead of the pulse amplitudes.  You have multiple zero crossings per pulse, though, because of the low-cut filters inherent to the pickup and the phone's mic input.  Yours drop farther than this between transitions, and cross zero:

You could restore a more pulsy shape by using a low-boost filter:

and then measure the pulse lengths by how long they spend above some threshold.  Maybe a better idea is to differentiate the input to make the transitions into large spikes, take the absolute value, and detect them when they go above some threshold:

Then measure the time between pulses, and when the time between two pulses is approximately the same as the last two pulses, it's a 0, when it's approximately half of what it was between the last two pulses, it's a 1.

The magnetic degradation you talk about should be easy to remove with a low-pass filter.


Power Spectrum analysis arbitrary length signals

The answer depends on the statistical characterization of the signal. If the random EEG signal is stationary over when seen over 5 second cycles, then you are better off averaging over 5 seconds cycles. If not, then averaging over these 5 seconds cycles might not yield the best estimate. In that case better off averaging over the entire duration.


Object Tracking with Improved Detector of Objects Similar to Target

I didn't read the paper but let me provide some intuition about object detection and tracking. When you try to track a target in a video, object detection algorithms might not be enough and you need to support the algorithm with target tracking methods in bayesian framework. It could be Kalman filter or particle filter.
In particle filter or any Bayesian filter you first define your state which is composed of positions, velocities and dimensions in your case. You create random samples of states using importance distribution and use them to estimate the density of your state.
You are kind of correct by saying that these samples are points of pixels in the frame. However, there exist more information in the samples. There are also velocities and dimensions inside those samples. The algorithm eliminate less possible samples and move forward with more possible ones. In this way, you obtain most probable pixels that object could exist. You also obtain most probable velocity and dimension for the object.


Direct and Transpose Polyphase Multirate Processing

The antialiasing filters here are FIR so there's no difference in the order of operations. If they were IIR there would be implications, see NUMERICAL ROBUSTNESS OF TDF-II. I think the classical representation of polyphase decimators and interpolators here is an elegant way to say that filtering has to occur at the lowest rate (before interpolation or after decimation).


What are the typical causes of clicks and pops in an audio file?

Clicking in an audio stream is typically indicative of some kind of discontinuity in the time-domain waveform. I'm not sure what you mean by "zeroed out and dc-offset corrected," but these sort of artifacts can be created via unsophisticated audio editing methods. If you're suggesting, though, that an all-zero (i.e. pure silence) audio file will cause this behavior, then there's probably some little implementation detail that's causing it. Examples:

Audible effects caused by turn-on/turn-off of the output audio amplifier. This is relatively common.
Significant differences between the initial/final sample values and the output level forced to the DAC when "idle" (I can't think of a sane reason why the designer wouldn't make the DAC output zero when not in use, but it's possible to do something else).


How does modulation work in simple language?

In order to understand the integral occurring in frequency modulation you need to understand the relation between phase and frequency. A sinusoid with frequency $f$ can be written as

$$x(t)=\sin(2\pi f t)\tag{1}$$

where the argument $2\pi f t$ is called the phase $\phi(t)$. The frequency is the derivative of the phase divided by $2\pi$:

$$f=\frac{1}{2\pi}\frac{d\phi(t)}{dt}\tag{2}$$

If the frequency is not constant, the relation $(2)$ still holds. Assume now that the frequency is a function of time $f(t)$. From ($2$), the phase can be determined from the frequency by integration:

$$\phi(t)=2\pi\int_{0}^tf(\tau)d\tau\tag{3}$$

In frequency modulation, the frequency of the carrier is changed according to the message signal $m(t)$ around a given (average) carrier frequency $f_c$:

$$f(t)=f_c+\Delta f\cdot m(t)\tag{4}$$

where $\Delta f$ is the maximum frequency deviation, assuming that $|m(t)|\le 1$. From $(3)$ and $(4)$ we can obtain the phase

$$\phi(t)=2\pi f_ct+2\pi\Delta f\int_0^tm(\tau)d\tau\tag{5}$$

From $(5)$, the frequency modulated signal can be written as

$$s(t)=\sin(\phi(t))=\sin\left(2\pi f_ct+2\pi\Delta f\int_0^tm(\tau)d\tau\right)\tag{6}$$

Your understanding of amplitude modulation seems to be correct. You simply multiply the carrier with a non-negative signal that is obtained from the message signal plus a constant. The constant must be chosen such that the sum remains positive.


what is happening when i run this code line?

You are putting the values of

u(2),...,u(10)

in a $3\times 3$ matrix with the shape of the index matrix $x$. This could be written simply as $$x2_{(i,j)}= u (x_{(i,j)}+1),\;(i,j)\in[1,2,3]\times[1,2,3]\,. $$

For further matrix shape conversions, you can have a look at vectorization or matricization, and you can find notations in chapter 3.4 Matricization of a tensor of Multilinear operators for higher-order decompositions, T. Kolda, 2006.


Under what conditions is the convolution of an input signal with the system's impulse response periodic?

I am somehow rephrasinge what @Hilmar already answered. In the continuous-time setting, convolution cannot invent frequencies. Indeed, there is an intimate relationship between Fourier and convolution, that is not always taught properly. Recently, Michael Bronstein was Deriving convolution from first principles

Have you ever wondered what is so special about convolution? In this
post, I derive the convolution from first principles and show that it
naturally emerges from translational symmetry.

The basic assumptions that a system is linear, and invariant by shift or in time (LTI) imply the concept of convolution. And convolution implies that a sine undergoing an LTI system will still be a sine, albeit with a time-shift (phase change) and amplitude modification (it can even vanish). In other symbols, through an LTI:
$$ \sin(\omega t)\to A\sin(\omega t+\phi)$$
$A$ can be zero, so frequencies can disappear. Yet if  $\sin(\omega t)$ is not present in the original data (no $\omega$), it cannot reappear. Frequency creation from nothing is a feature of nonlinear or time-variant systems.


There are for instance coherence and (cross)correlation which are commonly used mostly because of their computational/practical attractiveness. If you need to go beyond second order relationship, that is higher order dependencies, you can look at (cross)cumulants. From information theory you may want to look at (cross)entropy and mutual information.


Filter for DC component in FFT2 of image

When processing noisy data, it is usually beneficial to filter high frequencies, this can be done with a small kernel as shown in answer by Dan Boschen.
Also if your data has an envelope it will give you some high intensity low frequencies, the low frequencies require a long kernel to be filtered, and it is better to do in the frequency domain.
The topic of filter design has been extensively explored in the past but for 1D filtering (time domain). I use the 2D information to construct a direction independent filter.
Also, since the idea of this filtering is just to emphasize certain frequencies and we don't need to implement the transfer function in any recurrence equation, I just multiply the magnitude of the filter leaving the phase unchanged (I know your problem).
img = img - mean(img(:));
IMG = fft2(img);
[M, N] = size(IMG);
figure, imagesc(abs(IMG(1:64, 1:64)));

The frequencies you are interesteed in are problably those in the second spot close to 10 in the vertical axis. But we have a some frequencies that are detected higher represented at the top left corner of the image. Those need to be attenuated so that you can capture the frequencies of interest.

I will create a transfer function for a wide bandpass filter by cascading a
a high pass filter with cutoff in 10/v, and a lowpass filter at 200/v
The low frequencies are due to the envelope
f1 = 10/(N+M);;
f2 = 200/(N+M);
H = @(f) abs(f1 ./ (f1 + 1j*f) .* (1j.*f) ./ (1j*f + f2));
% see the filter response
x = linspace(0, 0.5, 1000);
figure, loglog(x, H(x));

Assuming each pixel corresponds to a square in the space (a rectanble with width = height) we can compute a frequency measured in cycles per pixel (where pixel corresponds the physical distance that separates two pixels)
% Spatial frequencies measured in cycles per pixel in each direction
phi_y = angle(exp(2j*pi*(0:M-1)/M))/(2*pi);
phi_x = angle(exp(2j*pi*(0:N-1)/N))/(2*pi);

% Construct a matrix of freq
F = sqrt(phi_y'.^2 + phi_x.^2);

If you have the actual length of each pixel you can simply divide phi_x and phi_y by the corresponding lengths.
As I said we have two options, one is to apply the analytic filter, but that changes the phase, or simply apply a real filter, by multiplying the magnitude.
Let's double check if this filtering does not modify too much the images by plotting them.
figure,
subplot(221);
imagesc(real(ifft2(IMG .* H(F))));
colormap('gray'), colorbar();
title('Analytic filter');
xticks([]);
yticks([]);
ylabel('real');

subplot(223)
imagesc(imag(ifft2(IMG .* H(F))));
colormap('gray'), colorbar();
xticks([]);
yticks([]);
ylabel('imaginary');

subplot(222);
imagesc(real(ifft2(IMG .* abs(H(F))))), colormap('gray'), colorbar();
xticks([]);
yticks([]);
title('Magnitude filter');

subplot(224);
imagesc(imag(ifft2(IMG .* abs(H(F))))), colormap('gray'), colorbar();
xticks([]);
yticks([]);

In my opinion the real filter is good, it does not leak the signal to the imaginary part and keeps the appearance of the image the same, the information you want is still there. If you want want you can increase f1 so that it filters the low frequencies even more, and you could for instance multipy by the square of the filter magnitude.
Now the last thing is to check if the peak we expect is the higher than the ones at the top left corner.
figure, imagesc(abs(IMG .* H(F))(1:64, 1:64)), colorbar();


What do triangles mean in frequency aliasing depiction?

The sampling rate is 6 kHz, so all the spectral content of what you are sampling will appear in the frequency range of -3 kHz < f < 3 kHz. The unshaded triangle from 3 kHz to 9 kHz is where the actual spectral content is.

When you sample at 6 kHz the spectral content of the unshaded triangle will appear as the triangle in the shaded region. More specifically the frequency at 4 kHz will appear at -2kHz, and the frequency at 7 kHz will appear at 1 kHz. Another way of saying this is, if you sample at 7kHz tone at 6 kHz it looks exactly the same as a 1 kHz tone sampled at 6 kHz. That's why aliasing leads to ambiguity - you can't tell whether that 1 kHz tone actually came from a 1 kHz, or a 7 kHz tone.

So the unshaded triangle represents where the original spectral content is, and the triangle in the shaded portion is where that triangle gets mapped to (when sampling at 6 kHz).


You should be more clear about Detecting Bass.

Bass instrument detection (i.e. polyphonic pitch tracking) and Bass Drum detection (to compute "rhythmic features" or tempo/BPM) are two different tasks. I'll assume you're talking about the latter.

I recommend looking at the open source music-analysis library called librosa, you can do tempo analysis in one line, on audio you've read into memory. You can also use the computed beats to compute various other beat-synchronous features:

import librosa
y, sr = librosa.load(librosa.util.example_audio_file(),sr=None)
tempo, beats = librosa.beat.beat_track(y=y, sr=sr)
print(tempo)
print(beats)

Links to digest:

https://github.com/librosa/librosa/blob/master/examples/LibROSA%20demo.ipynb
http://librosa.github.io/librosa_gallery/


If you look at the idea of Continuous Time Fourier Series (CTFT), it says any periodic signal can be constructed by summation of infinite number of complex exponentials. But in descrete case , only 'N' different  complex exponentials are enough , because there are only 'N' distinct complex  exponentials exists (N is the period of discrete signal).

DFT is nothing but DFS (Discrete Fourier Series).So You can extend the
same idea to get the answer.


Why are ideal filters not particularly useful/ hard to do?

You can only make a finite-order digital filter, since you don't have infinite CPU capacity, infinite RAM, infinite numerical precision and infinite time to wait.

With a finite-order filter, the Z-transform will be an analytic function over the complex domain. The frequency response is the Z-transform evaluated over the closed path $z = e ^{j\Omega}$ (i.e. the unit circle), where $\Omega$ is the frequency.

An analytical function evaluated over a path will result in an infinitely derivable and continuous frequency response (property of analytical functions, as long as you don't step over poles).

An ideal LPF is discontinuous at the cutoff frequency. So not possible to implement.

In practice, since the ideal LPF is a discontinuous frequency response, adding more coefficients to your filter will converge slowly to the desired frequency response (convergence is in mean-quadratic sense, which is slow). So you will end up with a filter with many coefficients, bad frequency response, lot of delay, and lots of roundoff errors.


how to lower frequency of a sound file in matlab?

In the end, i took the advice of @chipaudette
in his answer to a similar question
link to answer
and i used Audacity to lower frequency, worked like a charm. in case anyone want's to see the final product, i add a link.
link to manual
link to final product


Phase difference calculation between two wave files

Is this the correct way?

This may be technically correct but won't give you any useful information. The reasons for this are actually quite simple. The phase between two signals can be computed
accurately only if your signals contain pure sine tones. You basically have only 2 scenarios where computing the phase difference between 2 signals makes sense.

a) the 2 signals both contain the same frequency component but have
a phase shift between them
b) the 2 signals contain each a
different frequency component

For case #a, the phase difference will remain the same throughout the entire length of the signals, whereas in #b, the phase difference will change as you traverse the length of the signals (it's assumed that the frequency in signal #2 is not a multiple of the frequency in signal #1 and the signals don't start in phase)

When you have a signal that contains multiple frequency components, the phase calculated by an FFT routine (including librosa.stft, which computes dft on multiple signal frames) is pretty
much random (you can think of it as being the average of all frequency components contributing to a particular frequency bin, including noise i.e. undesirable components).

This means that computing the phase difference for the  purpose of  finding the true phase difference between  2 random signals is not possible and is completely meaningless.
Computing the phase difference (within a single signal) can still be useful in other applications where it can be used to  more accurately estimate the "true" bin frequencies but here it's the relative phases that we're dealing with so it's different.

In conclusion, if your signals don't fit either case a# or case b#, you won't be able to do what you want and it doesn't even make sense to try to do that in the first place.


For SNR calculation, should I use FFT|X+iY| or FFT|R|?

To calculate the SNR you need to get the signal's power. One way to do this is in the time domain, but Parseval's theorem says that the power in the time domain is equal to the power in the frequency domain as it should be..it is the same signal after all. The DFT version of the theorem is $\sum_{n=1}^N|x[n]|^2=\frac{1}{N}\sum_{k=1}^N|X[k]|^2$, where $X[k]$ is the DFT of $x[n]$, which means that the power will be determined by its magnitude squared and the phase has no part in the calculation.


What is imaginary part after IFFT and how to use it?

And as far as I know the real numbers mean magnitudes of each frequency bin, and imaginary numbers mean phase shifh of each frequency bin.

No. The magnitude of the complex spectrum $|X(k)|$ means magnitude of each freqency bin, and the phase angle of the complex spectrum $\angle X(k)$ represents phase shift.

But then what mean imaginary part of IFFT output?

If the input of IFFT is conjugate symmetric, the output of IFFT must be a real signal, and vice versa, FFT of a real signal must be conjugate symmetric.


You need to resample the signal to simulate the Doppler induced dilation. The resampling factor is I=Td/Ts
where
Td = Duration of the signal after dilation
Ts = Actual duration of the transmitted signal

In Matlab you can use the function resample(), but you need to find the resampling parameters P and Q from I.

Also, I=1+v/c for signal expansion and I=1-v/c for signal compression. v=speed of movement in m/s and c=speed of wave propagation in the medium. For instance sound underwater c=1500 m/s.

In Matlab, you can find P and Q as [P,Q]=rat(I);


How can I reconstruct a 3D structure from a set of images?

Actually it is quite a hard topic. Classical multi-view 3d reconstruction deals with point matching in the first place, i.e. find the same point on every image. Given the camera (view) parameters for each image, the original 3d point can be reconstructed. (Using a laser or a projector the scene can be lit so the matching can be done relatively easily.)

The bible of the field is Multiple View Geometry in Computer Vision by Hartley and Zisserman

In the book there is a section about the trifocal tensor, which is a multilinear constraint between 3 views. It contains not just point but line correspondence constraints as well. It can be used for building reconstruction very well.

So your contours should be matched at the first place, and maybe can be reconstructed knowing the camera parameters (camera calibration is also covered in the book). Then you will have contours in 3d but nothing more. For real surfaces you have to do dense point matching. Though the tensor I mentioned look good it is used for straight lines and I am sure that a modern car has curved lines all over.

I do not know how you got those contours but seeing the image you have posted I am quite sceptic about the robustness of that algorithm, so the reconstruction will be poor.

Another method it came to my mind is visual hull or space carving. The contour mathcing should also be done. Running the method on each contour you can have the model.


Classifying and filtering out noise from zero crossings

Without knowing the context, here is what probably is meant:

3.75 refers to a more real-world sensor. The sensor described in 3.74 apparently is assumed to be perfect, ie whenever there is a negative/positive sensor data, the true signal does have the associated property. Ideal sensors, however, do not exist and 3.75 tells you, that your sensor does have imperfections that lead to spurious false sign alterations. The sensor shall be assumed to produce randomly additional zero-crossings that might look like that:

Instead of: 1 0  1 2 3  1 -5 -2 -2 -1 5 3
You get:    1 3 -2 3 2 -2 -4  3 -2 -1 2 3

Your example data suggested that a positive/negative periods are typically longer than just one measurement. You are supposed to "harden" your filter a bit to still provide the valid zero-crossings. This filter will never be perfect, but it should be better than the naive filter you probably implemented for 3.74.

In 3.74 you probably implemented a simple if-check: If the sign alternates between measurement $n-1$ and $n$, spit out the corresponding 1 or -1. A hardened filter could be implemented by looking back $n-k$ points with $k=1,2,3,...$ chosen appropriately and spit out a 1 or -1 if all of the $k$ points were of the same sign. This, however, would introduce a delay into your filter, and it would miss zero-crossings that are shorter than $k$ points. So, key would be to know the shortest duration between two zero crossings and choose $k$ smaller than that, and it would be important to know whether or not the delay is acceptable.

And no, noise does not refer to the zeros in your signal ;)


Detect playback position in swept sine sweep

Attached Matlab sample code to apply an matched filter to a sine sweep for finding the playback position (the playback position estimate can be derived as the position of the peak in the matched filter plot):

% params

sampling_rate = 44000;
f_low = 10;
f_high = 100;
shift_percent = 0.0;
shift_samples = 30000;

% init
t = 0:1/sampling_rate:1;
N = length(t);
y = chirp(t,f_low,1,f_high, "linear");
y_inv = flip(y);
if(shift_percent ~= 0.0)
    y = circshift(y, round(shift_percent * N));
else
    y = circshift(y, shift_samples);
end
figure(235)
plot(y)
fade = [linspace(0, 1, (N/2)), linspace(1, 0, (N/2) + 1)];
y = y .* fade;
y_inv = y_inv .* fade;
y_matched = conv(y, y_inv);
figure(236)
plot(y_matched)

% plot
fvtool(y)


How to simulate a continuous signal passing through a capacitor (simple coupling capacitor)

Is it necessary to take a derivative

Yes

or just get the first moment of the stochastic signal and eliminate

That's just a very crude approximation of taking the derivative. In some cases that's sufficient, but in most it's not.
For DC blocking the capacitor is typically used together with a resistor to form a high pass filter. The approximation is often "good enough" if the corner frequency of the high pass is well below any signal frequency of interest.


Your code is performing the QPSK demodulation. it's assigning the odd value for real value and even values for Imaginary valued Or, the opposite, try to re-check. And Then make the QPSK demodulation.

About you question, how to do the qpsk demodulation,  you can do it as below:

% suppose you have data for 48, 2-bit symbols
       data = randi([0 1],96,1);
 % Create a QPSK modulator System object with bits as inputs and Gray-coded signal constellation
       qpsk_mod = comm.QPSKModulator('BitInput',true);
 % Modulate and plot the data
       modData = step(qpsk_mod , data);
       scatterplot(modData)

Go to MATLAB and check the help of comm.QPSKModulator, then you can explore the demodulation easily.

you can also check this web page for deep understanding https://www.gaussianwaves.com/2010/10/qpsk-modulation-and-demodulation-2/

Good Luck


LableMe does same work as SegNet but manually. You can learn about this tool from this video tutorial

To start using this tool you have to create an account on LabelMe website.


Does an equivalent transformation of a signal to a spectrogram image exist in which the phase information is part of the resulting image?

If you create a volumetric (unflattened 3D) image, you can use 2 layers in the 3rd dimension to represent magnitude and phase, or real and imaginary components of a complex spectrogram output.

In a 2D color spectrogram, you could try using an orthogonal color mapping, for instance, in RGB space, red + green for magnitude and blue (or delta blue) for phase, or similar for real and imaginary components, or use YUV or HSL color spaces, etc.


Finding polynomial approximations of a sine wave

about a decade ago i did this for an unnamed music synthesizer company who had R&D not too far from my condo in Waltham MA.  (can't imagine who they are.)  i don't have the coefficients.

but try this:

$$\begin{align}
f(x) &\approx \sin\left(\tfrac{\pi}{2} x \right) \qquad \qquad \text{for }-1 \le x \le +1 \\
\\
     &= \tfrac{\pi}{2} x (a_0 + a_1 x^2 + a_2 x^4) \\
\end{align}$$

this guarantees that $f(-x) = -f(x)$.

To guarantee that $f'(x) \Big|_{x=\pm1} =0$ then

$$ f'(x) = \tfrac{\pi}{2}( a_0 + 3 a_1 x^2 + 5 a_2 x^4) $$

$$ a_0 + 3 a_1 + 5 a_2 = 0 \tag{1}$$

That's the first constraint.  To guarantee that $|f(\pm 1)| = 1$, then

$$ a_0 + a_1 + a_2 = \tfrac{2}{\pi} \tag{2}$$

That's the second constraint.  Eliminating $a_0$ and solving Eqs. (1) and (2) for $a_2$ in terms of $a_1$ (which is left to adjust):

$$ a_0 =  \tfrac{5}{2 \pi} - \tfrac{1}{2} a_1 $$

$$ a_2 = -\tfrac{1}{2 \pi} - \tfrac{1}{2} a_1  $$

Now you have only one coefficient, $a_1$, left to twiddle for best performance:

$$ f(x) = \tfrac{\pi}{2} x \left((\tfrac{5}{2 \pi} - \tfrac{1}{2} a_1) + a_1 x^2 -  (\tfrac{1}{2 \pi} + \tfrac{1}{2} a_1)x^4 \right) $$

This is the way I would twiddle $a_1$ for best performance for a sine wave oscillator.  I would adjust use the above and the symmetry of the sine wave about $x=1$ and place exactly one entire cycle in a buffer with a power of two number of points (say 128, i don't care) and run the FFT on that perfect cycle.

The FFT result bin 1 will be the strength of the sine and should be about $N/2$.  Now you can adjust $a_1$ to bring your 3rd harmonic distortion up and down.  I would start with $a_1 \approx \tfrac{5}{\pi} - 2$ so that $a_0 \approx 1$.  That's in bin 3 of the FFT results  But the 5th harmonic distortion (value in bin 5) will be consequential (it will go up as the 3rd harmonic goes down).  I would adjust $a_1$ so that the strength of the 5th harmonic level is equal to the 3rd harmonic level.  It will be around -70 dB from the 1st harmonic (as I recall).  That will be the nicest-sounding sine wave from a cheap, 3-coefficient, 5th-order, odd-symmetrical polynomial.

Someone else can write the MATLAB code.  How does that sound to you?


Relation between impulse response and Region of convergence?

For a discrete-time system if the impulse response is IIR and right sided, then the ROC will be outside of the largest pole. Else if the impulse response is IIR and left sided, then the ROC will be inside of the smallest pole.

For all FIR (finite inpulse response) systems, the ROC will be all $z$ except possibly zero and/or infinity.

For the continuous-time systems, for right sided impulse responses, the ROC will be to the right (half plane) of the max pole, and for left sided impulse responses it will be to the left of the minimum pole.


Extracting common signal from 4 sets of observations

Because you have a set of linear equations, why don't you set up a linear system (for each data point) and solve the system (using SVD for example) to obtain the solution?

Write in the the matrix form such as $Y=\beta X$ where $\beta$ are known and $X$ is unknown.


How does nearest neighbour, bilinear and cubic interpolation work in images?

Here is an illustration of bicubic interpolation, which typically needs 4x4 input pixels to calculate one output pixel:

Figure 1. Bicubic interpolation from 4x4 input pixel values to calculate one output pixel value. a) The output pixel must be located in the greyed area with respect to the input pixels (black dots). b) Four intermediate values (red dots) are independently calculated by interpolating horizontally from each row of four input pixels. c) Using the same interpolation method, the output value (blue dot) is interpolated vertically from the column of four intermediate values.

Each interpolation amounts to a weighted sum of four values, with the weights given by cubic polynomials of horizontal or vertical position within the grey square.

Bilinear interpolation works similarly but only has as input the 2x2 pixels at the corners of the grey square, and the polynomials are linear.

Nearest neighbor interpolation has the grey square centered at a pixel, and simply that pixel value is output.


I would say that the answer to your question - if taken literally - is 'no', there is no general way to simply convert an FIR filter to an IIR filter.

I agree with RBJ that one way to approach the problem is to look at the FIR filter's impulse response and use a time domain method (such as Prony's method) to approximate that impulse response by an IIR filter.

If you start from the frequency response then you have lots of methods for designing IIR filters. Even though it was published about 25 years ago, I believe that the method by Chen and Parks is still one of the better ways to approach the design problem. Another very simple method for the frequency domain design of IIR filters is the equation error method, which is described in the book Digital Filter Design by Parks and Burrus. I've explained it in this answer.

If the phase response is of importance to you, then one problem you will be facing when designing IIR filters in the frequency domain is the exact choice of the desired phase response. If the overall shape of the desired phase is given you still have one degree of freedom, which is the delay. E.g., if the desired phase is $\phi_D(\omega)$, and the desired magnitude is $M_D(\omega)$ then your desired frequency response can be chosen as

$$H_D(\omega)=M_D(\omega)e^{j(\phi(\omega)-\omega\tau)}\tag{1}$$

where $\tau$ is an unknown delay parameter. Of course you can say that if $\phi_D(\omega)$ is given then you don't want to modify it with an additional (positive or negative) delay. But it turns out that in practice the average delay is not always important, and - more importantly - for certain values of $\tau$ your approximation will be much better for a given filter order than for others. So the delay $\tau$ can become an additional design parameter and should be chosen optimally or at least reasonably.

I've written a thesis on the design of digital filters with prescribed magnitude and phase responses. One chapter deals with the frequency domain design of IIR filters. That method can be used to design IIR filters with approximately linear phase in the pass-bands, or to approximate any other desired phase (and magnitude) response. The filters are not only guaranteed to be stable, but you can also prescribe a maximum pole radius, i.e., you can define a certain stability margin. You can also find this method in a paper published in the IEEE Transactions on Signal Processing.


How do you apply Kalman Filter to track a signal?

The power of the Kalman filter lies in the effect that it predicts the next "state" of the signal/object by using an internal model of the process. That why it is very effective for physical processes, because they can (often) be modelled with quite large precision.

The fact that you point out that it is impossible to derive a model for your signal renders the effect of using (and even the possibility of using)  Kalman filter usesless/impossible.


Your first steps seem OK to me. Even if I'd put absolute values in the time domain as well (for generality), if the first three integrals exist, the fourth is valid. Integration is linear.

The weak point resides in the reverse inference. The equality of energy integrals does not mean that the integrands are related. For one, PDSs are real and positive functions. And there is NO reason why the Fourier transform of a sum of squared functions should be real and positive in general.

To convince your advisor, I'd suggest you to build your question on a clever counter-example.


Improving template with instantaneous amplitude

Since I don't really know what you're using software-wise, I just whipped up a really short demo in GNU Radio Companion. This uses a PLL in a live processing demo:

If you're inclined to play around with it, here is the flow graph ready to be run if you've got a running installation of GNU Radio. The flow graph looks like this:

The left part up to the conversion to complex (which actually is a bit superfluous) is just the generation of a noise cosine.

The "PLL Freq Det" Block does pretty much what you describe: it compares the phase of the signal it observes with an internally generated oscillator, and generates a "phase signal" that is used to tell the internal frequency reference "how fast" it should oscillate. That signal is just a phase difference to be compensated, and needs to be internally filtered (the loop filter does that) before being applied to the internal oscillator.

At the same time, that signal is actually also a phase per sample - i.e., a frequency. So, you get a frequency estimate out of this.

Now, this is really practical for things like radio receivers that need to update their estimate of the received signal's frequency while operating, but in your case, you can do all this much more accurate, since you can actually work on the full signal.

A very popular (albeit, seldom optimal) estimator for the spectrum of a signal (and you're looking for which frequencies are making up your signal, so that's a question about the spectrum of your signal) is in fact the (magnitude of the) discrete fourier transform (DFT), often implemented by an FFT.

If you, for example, have your data in a Python program as vector signal, the following (untested) code should do interesting things to your signal:

import numpy
from matplotlib import pyplot

## Replace with your own samples and rate
samples = …
sampling_rate = 32e3

## Do a fourier transform of the whole data set
fourier_transform = numpy.fft.fft(samples)
positive_freq_components = fourier_transform[0:len(fourier_transform) / 2]
positive_freq_components_mag_squared = numpy.abs(positive_freq_components)**2
frequencies = numpy.linspace(0, sampling_rate / 2, len(fourier_transform) / 2)

## Plot that stuff!
pyplot.plot(frequencies, positive_freq_components_mag_squared)
pyplot.xlabel("Frequency (Hz)")
pyplot.ylabel("Digital Power")
pyplot.tight_layout()
pyplot.show()

This should give you a plot of power over frequency. Your noise will probably be relatively white, i.e. it will not have a lot of concentration in frequency domain. The sine, on the other hand, is very periodic and thus has all its energy at one frequency.

Note that I said "seldom optimal" about the DFT as spectrum estimator: It gives you the same frequency resolution all over your bandwidth, and you don't care about most frequencies. The (usable) frequency resolution depends linearly on the observation length, and you can't just get arbitrary frequencies by looking for peaks – all frequencies represented are sampling rate / length of DFT.

Other, "cooler", methods can give you a spectrum estimate that you can evaluate at arbitrary frequencies (such as MUSIC¹), or directly an estimate for the "strongest" frequency (or the strongest N frequencies) (such as ESPRIT¹). However, using these often requires a few strong assumptions, so I won't go deeply into that: If you want to know more about parametric estimators for fundamental frequencies, feel encouraged to research and ask a new question – there's folks on here way more experienced with such estimation tasks than I am.


HINT:

Just substitute $\tau=t-\mu$ in the integral and see what you get. It's just very basic math, no complicated properties of the Fourier transform. I assume that you know the definition of $\hat{g}(\eta)$.


Commenting frequency spectrum of a sampled data

Consider the 3V component first (note that aliassing only affects frequency, not amplitude, so the 3V component will have the same magnitude at whatever frequencies it is aliassed to):

For Fs = 115 Hz the 3V component shows up at 2 Hz, so it's real frequency could be any value which satisfies f = 115*k +/- 2, i.e.

  2 Hz
113 Hz
117 Hz
228 Hz
232 Hz
...

Do the same thing for Fs = 280 Hz, where we have f = 280*k +/- 48:

 48 Hz
232 Hz
328 Hz
512 Hz
608 Hz
...

And then again for Fs = 500 Hz:

232 Hz
268 Hz
732 Hz
...

We can see that the only frequency which corresponds in all 3 cases is 232 Hz, so it looks like we have a 3V component at f = 232 Hz.

You can now apply the same approach to identify the frequency of the 1V component.


What I would try is to :

Get the HSL (Hue Saturation Lightness) decomposition of the original picture
Only keep the L component
Multiply the image you have from the last steps with the image you get after the morphological operation (the black and white one, after deleting the noise)
Do some thresholding on that
Use what you obtained from that instead of the image after the morphological operation for the following part of the algorithm.

I don't know well Matlab so I can't provide function names, but I guess you can find it easily with a bit of googling. And please keep me updated if you try this, I would like to know if it works well or not.


$|X(e^{jω})|^2$ - Power or Energy Density?

do you see anywhere in your book where this "DTFT" is defined for your w.s.s. process, $x[n]$?  the DTFT is normally defined as

$$ X(e^{j \omega}) \triangleq \sum\limits_{n=-\infty}^{+\infty} x[n] e^{-j \omega n} $$

but for this infinite sum to converge, we normally require that

$$ \sum\limits_{n=-\infty}^{+\infty} \Big|x[n]\Big| < +\infty $$

which is a stronger requirement than

$$ \sum\limits_{n=-\infty}^{+\infty} \Big|x[n]\Big|^2 < +\infty $$

which says simply that the energy of $x[n]$ is finite, and $x[n]$ is a finite energy signal or just an energy signal.

a finite power signal or just a power signal does not satisfy the restrictions above, but satisfies this:

$$ \lim_{M \to +\infty} \frac{1}{2M+1} \sum\limits_{n=-M}^{+M} \Big|x[n]\Big|^2 < +\infty $$

sometimes, to do some math, we have to express this a little more strictly as

$$ \lim_{M \to +\infty} \frac{1}{2M+1} \sum\limits_{n=-M}^{+M} \Big|x[n]\Big| < +\infty $$

both restrictions are equivalently true, but the first one is expressing power directly.

so these "energy signals" and "power signals" live in different metric spaces, or more particularly, they live in different Hilbert spaces.

Hilbert spaces have something that we call "inner product" (or sometimes "dot product"):

$$ \big\langle x,y \big\rangle \quad \text{ or } \quad \big\langle x[n],y[n] \big\rangle $$

and we always define the norm of $x[n]$ in terms of this inner product:

$$ \big\| x \big\| \triangleq \sqrt{\big\langle x,x \big\rangle}  $$

now the inner product for the space of energy signals is defined to be:

$$ \big\langle x[n],y[n] \big\rangle \triangleq \sum\limits_{n=-\infty}^{+\infty} x[n] \cdot \overline{y[n]} $$

where $\overline{y[n]}$ is the complex conjugate of $y[n]$.  FYI, we see that the inner product is "conjugate commutative":

$$ \big\langle x,y \big\rangle = \overline{\big\langle y,x \big\rangle} $$

it should be easy to see that the norm $\big\| x \big\|$ is just the square root of the total energy:

$$\begin{align}
 \big\| x \big\|^2 &= \big\langle x,x \big\rangle \\
   &= \sum\limits_{n=-\infty}^{+\infty} x[n] \cdot \overline{x[n]} \\
   &= \sum\limits_{n=-\infty}^{+\infty} \Big|x[n]\Big|^2 \quad < \infty \\
\end{align} $$

similarly, the inner product for the space of power signals is defined to be:

$$ \big\langle x[n],y[n] \big\rangle \triangleq \lim_{M \to +\infty} \frac{1}{2M+1} \sum\limits_{n=-M}^{+M} x[n] \cdot \overline{y[n]} $$

again, the inner product is conjugate commutative:

$$ \big\langle x,y \big\rangle = \overline{\big\langle y,x \big\rangle} $$

and we see that the norm $\big\| x \big\|$ is just the square root of the total power:

$$\begin{align}
 \big\| x \big\|^2 &= \big\langle x,x \big\rangle \\
   &= \lim_{M \to +\infty} \frac{1}{2M+1} \sum\limits_{n=-M}^{+M} x[n] \cdot \overline{x[n]} \\
   &= \lim_{M \to +\infty} \frac{1}{2M+1} \sum\limits_{n=-M}^{+M} \Big|x[n]\Big|^2 \quad < \infty \\
\end{align} $$

now for both energy and power signals, we can define the cross-correlation between two signals as:

$$ R_{xy}[m] \triangleq \big\langle x[n+m], y[n] \big\rangle $$

for energy signals it's

$$\begin{align}
 R_{xy}[m] & = \big\langle x[n+m], y[n] \big\rangle \\
     & = \sum\limits_{n=-\infty}^{+\infty} x[n+m] \cdot \overline{y[n]} \\
\end{align}$$

for power signals it's

$$\begin{align}
 R_{xy}[m] & = \big\langle x[n+m], y[n] \big\rangle \\
     & = \lim_{M \to +\infty} \frac{1}{2M+1} \sum\limits_{n=-M}^{+M} x[n+m] \cdot \overline{y[n]} \\
\end{align}$$

the autocorrelation of $x[n]$, denoted $R_{xx}[m]$, is simply the cross-correlation of $x[n]$ with itself

$$ R_{xx}[m] = \big\langle x[n+m], x[n] \big\rangle $$

the spectral density is the DTFT of the autocorrelation

$$ S_{xx}(e^{j\omega}) = \sum\limits_{m=-\infty}^{+\infty} R_{xx}[m] \, e^{-j \omega m} $$

and, more generally, the cross-spectral density is the DTFT of the cross-correlation

$$ S_{xy}(e^{j\omega}) = \sum\limits_{m=-\infty}^{+\infty} R_{xy}[m] \, e^{-j \omega m} $$

now, for a deterministic (that means $x[n]$ is known for all $n$) and finite energy signal, the DTFT of $x[n]$ is defined

$$ X(e^{j \omega}) = \sum\limits_{n=-\infty}^{+\infty} x[n] e^{-j \omega n} $$

and it can be shown that the spectral density is simply the magnitude-square of the DTFT:

$$ S_{xx}(e^{j\omega}) = \Big| X(e^{j \omega}) \Big|^2 $$

the proof is as

$$\begin{align}
\Big| X(e^{j \omega}) \Big|^2 &= X(e^{j \omega}) \cdot \overline{X(e^{j \omega})} \\
  &= \left( \sum\limits_{n=-\infty}^{+\infty} x[n] e^{-j \omega n} \right) \overline{\left( \sum\limits_{n=-\infty}^{+\infty} x[n] e^{-j \omega n} \right)} \\
  &= \left( \sum\limits_{n=-\infty}^{+\infty} x[n] e^{-j \omega n} \right) \left( \sum\limits_{n=-\infty}^{+\infty} \overline{x[n] e^{-j \omega n}} \right) \\
  &= \left( \sum\limits_{n=-\infty}^{+\infty} x[n] e^{-j \omega n} \right) \left( \sum\limits_{n=-\infty}^{+\infty} \overline{x[n]} e^{+j \omega n} \right) \\
  &= \left( \sum\limits_{m=-\infty}^{+\infty} x[m] e^{-j \omega m} \right) \left( \sum\limits_{n=-\infty}^{+\infty} \overline{x[n]} e^{+j \omega n} \right) \\
  &=  \sum\limits_{m=-\infty}^{+\infty} \sum\limits_{n=-\infty}^{+\infty} x[m] e^{-j \omega m} \overline{x[n]} e^{+j \omega n} \\
  &=  \sum\limits_{m=-\infty}^{+\infty} \sum\limits_{n=-\infty}^{+\infty} x[m] \overline{x[n]} e^{-j \omega (m-n)} \\
  &=  \sum\limits_{m=-\infty}^{+\infty} \sum\limits_{n=-\infty}^{+\infty} x[n+m] \overline{x[n]} e^{-j \omega (n+m-n)} \\
  &=  \sum\limits_{m=-\infty}^{+\infty} \left(\sum\limits_{n=-\infty}^{+\infty} x[n+m] \overline{x[n]} \right) e^{-j \omega m} \\
  &=  \sum\limits_{m=-\infty}^{+\infty} R_{xx}[m] e^{-j \omega m} \\
  &=  S_{xx}(e^{j \omega}) \\
\end{align}$$

this is the case for a finite energy signal.  but for a power signal, $x[n]$, the DTFT $X(e^{j \omega})$, does not simply exist without some hand-waving using the dirac delta function $\delta(\omega)$ in the frequency domain, which i do not want to do, and will stay away from that kind of representation.  but the power spectral density $S_{xx}(e^{j \omega})$ continues to exist for power signals, even if the DTFT and $\Big|X(e^{j \omega})\Big|^2$ do not.

Filtering

whether these are both energy signals or both power signals, with $x[n]$ as input and $y[n]$ as output, a discrete-time LTI system (or "filter") will relate the two with the convolution summation:

$$\begin{align}
 y[n] &= \sum\limits_{m=-\infty}^{+\infty} h[m] x[n-m] \\
      &= \sum\limits_{m=-\infty}^{+\infty} h[n-m] x[m] \\
\end{align}$$

in the frequency domain, taking the DTFT of both sides is

$$ Y(e^{j \omega}) = H(e^{j \omega}) \cdot X(e^{j \omega}) $$

the impulse response $h[n]$ must be a finite energy signal

$$ \sum\limits_{n=-\infty}^{+\infty} \Big|h[n]\Big|^2 < +\infty $$

and the frequency response $H(e^{j \omega})$ is the DTFT of the impulse response

$$ H(e^{j \omega}) = \sum\limits_{n=-\infty}^{+\infty} h[n] e^{-j \omega n} $$

if $x[n]$ and $y[n]$ are energy signals, it follows directly that

$$\begin{align}
Y(e^{j \omega}) &= H(e^{j \omega}) \cdot X(e^{j \omega}) \\
\\
\Big|Y(e^{j \omega})\Big| &= \Big|H(e^{j \omega})\Big| \ \Big|X(e^{j \omega})\Big| \\
\\
\Big|Y(e^{j \omega})\Big|^2 &= \Big|H(e^{j \omega})\Big|^2 \ \Big|X(e^{j \omega})\Big|^2 \\
\\
S_{yy}(e^{j \omega}) &= \Big|H(e^{j \omega})\Big|^2 \ S_{xx}(e^{j \omega}) \\
\end{align}$$

but to show this for finite power signals is a little more difficult.  remember that for $y[n]$, $S_{yy}(e^{j \omega})$ continues to exist, even if the DTFT $Y(e^{j \omega})$ and $\Big|Y(e^{j \omega})\Big|^2$ do not.  and the convolution operation continues to exist with the same summation expression for power signals as with energy signals.

recall for power signals, the autocorrelation is:

$$\begin{align}
 R_{yy}[m] & = \big\langle y[n+m], y[n] \big\rangle \\
     & = \lim_{M \to +\infty} \frac{1}{2M+1} \sum\limits_{n=-M}^{+M} y[n+m] \cdot \overline{y[n]} \\
\end{align}$$


Block diagram transfer function of a line

The transfer function of a line is 1.

And hence you can reduce your blocks into a single block with transfer function
$$\frac{C(s)}{R(s)} = \frac{G(s)}{1+G(s)}$$

where, $$G(s) = \frac{K}{s(s+2)(s+3)+s}$$


Does the number of samples matter for FFT, and how to get a specific frequency visible?

The "information content" is related to the number of samples.  The length of the FFT merely interpolates the spectral frequency curve represented by the number of samples.  If an FFT result bin doesn't end up exactly centered on some desired frequency, you can interpolate it from the nearest bins, using a high-quality (Sinc kernel, et.al.) interpolator, since FFT bins have a greater-than-zero bandwidth (the shape of the transform of the default rectangular or other window).  Using a longer zero-padded FFT gives you more interpolation points, and thus a denser looking point plot, but no better spectral separation resolution than provided by the number of actual samples.


Help in understanding the IQ raw file format used by SDRs/GnuRadio

As @Marcus_Müller points out, dropping samples will corrupt whatever digital symbol or analog waveform you were operating on at that instant.

You'll also introduce discontinuities in the time domain, which means you'll get broadband noise in the frequency domain at that time.

Probably the worst effect is, that if you drop a half sample, you end up swapping I & Q and the spectrum gets inverted.  Mathematically, if:

$$ x(t) e^{j\omega t} = I(t) + jQ(t) $$

then

$$ Q(t) + jI(t) = x(t)e^{-j\omega t +j\frac{\pi}{2}}$$

So you get spectral inversion about DC.  If your signal of interest was not centered and symmetric about DC, then your downstream DSP will yield junk.


Are all of the edge descriptors necessary to differentiate edges?

You can calculate the edge direction from the edge normal by atan2(y,x)link.
The other descriptors are independent of each other and thus only the problem itself can tell if they are necessary or not.


Filter Percentage Uniform Noise from a DC-signal?

The sample mean can be a choice for the estimator with the following pros and cons

Pros:

it is unbiased

Cons:
1. The variance of the estimator increases with increase in absolute value of $x$

The estimator will converge to true value of $x$ only when number of observations over which the mean is taken is large.

A different approach is illustrated below, though estimation in uniform noise of this nature is not trivial and many a times the best that can be done is the sample mean over large data samples

Let $$y[n] = x + xw[n]$$ where w[n] is uniform between $[-0.5 \: 0.5]$. Let us denote the equivalent noise $z[n] = xw[n]$. The correlation between these equivalent noise samples accross time assuming that $w[n]$ are IID is $$E(z[n]z[n+1]^*) = E(xw[n]xw[n+1]^*)$$ since $x$ is deterministic and w[n] are IID hence $$E(z[n]z[n+1]^*) = 0$$ so $y[n]$ are uniform  RVs between $[0.5x \:   1.5x]$. The mean of each of this RVs is $x$. Therefore the sample mean is an unbiased estimator of $x$ $$ \hat{x} = \frac{\sum_n y[n]}{N}$$. The variance of the estimator is $$var(\hat{x}) = \frac{var(y[n] -x)}{N}$$
$$var(\hat{x}) = \frac{x^2}{12N}$$

However consider this $$p(y[n];x) = \frac{u(y[n] + 0.5x) - u(y[n] - 0.5x)}{x}$$

Since, the PDF above is nothing but $z[n]$ which are IID, hence combined off of $Y$ is $$p(Y;x) = \prod_{n=1}^{n=N}\,p(y[n];x)$$ the PDF will remain non zero as long as $-0.5x<y[n]<0.5x$, if this is the case the PDF is given by $$p(Y;x) = \frac{u(0.5x - max(y[n]))u(min(y[n] + 0.5x))}{x^N}$$

So $max(y[n])$ and $min(y[n])$ are joint sufficient statistics. The next step would be to find unbiased estimator of these statistics. For the case of IID uniform RVs this approach is illustrated in fundamentals of estimation theory by Stephen M Kay in the chapter on sufficient statistics to be $\frac{N+1}{2N +1}max(y[n])$, you can modify that a bit to this problem. It is shown to have less variance than the sample mean.

I have illustrated this method for the case where the sample mean doesn't make sense due to the cons mentioned above. In general estimation over uniform noise of this percentage nature is tricky.


How to combine a rotation matrix and a stretch matrix into a single matrix for easy Fourier Transform

You combine those by matrix multiplication.


Why do we use window in time domain rather than do FFT modify the spectrum and than inverse FFT

Windowing is used because the DFT calculations operate on the infinite periodic extension of the input signal. Since many actual signals are either not periodic at all, or are sampled over an interval different from their actual period, this can produce false frequency components at the artificial 'edge' between repeated intervals, called leakage. By first multiplying the time-domain signal by a windowing function which goes to zero at both ends, you create a smooth transition between repeated intervals in the infinite periodic extension, thus mitigating the creation of these artificial frequency components when we then take the DFT.

This paper gives a more in depth look at this phenomenon, as well as some insight into the effects of different windowing functions.


What equation predicts the amplitudes of harmonics from a square/triangle/sawtooth/pulse oscillator?

This is what Fourier series are all about. Under relatively mild conditions, a $T$-periodic function $f(t)$ can be represented as an infinite sum of complex exponentials:
$$f(t)=\sum_{k=-\infty}^{\infty}c_ke^{j2\pi kt/T}\tag{1}$$
Note that if $f(t)$ is real-valued, $(1)$ can equivalently be written as a sum of real-valued sinusoids:
$$f(t)=c_0+2\sum_{k=1}^{\infty}|c_k|\cos\left(\frac{2\pi kt}{T}+\phi_k\right)\tag{2}$$
with $c_k=|c_k|e^{j\phi_k}$. From $(2)$ it should be clear that not only the amplitudes $2|c_k|$ of the individual sinusoids but also the phases $\phi_k$ are important.
The complex Fourier coefficients $c_k$ are given by
$$c_k=\frac{1}{T}\int_{0}^{T}f(t)e^{-j2\pi kt/T}dt\tag{3}$$


Does every 8 by 8 DCT matrix have a valid (in range) IDCT?

All images blocks that are applied by DCT matrix have a valid IDCT - i.e. they can always bring back original pixels and in general inverse transfer is theoretically as well as computationally viable.
However, while your pixels have values in range 0-255 - the DCT matrix of the block never results in values which are confined between 0-255. Not only that, they are not even integers - they are real values. So while they are valid numbers, they can't be stored in the same container as pixels.
Given that they are real numbers, it would be useless to be used for compression against integers of the original source. So hence they are confined in a particular range and then divided by a specific number - this is a process of quantization. Hence, what really goes inside your JPG or MPG are quantized co-eofficients.
The quantization is not equal. Certain components are preserved more than others (with finer quantization) - hence dynamic range of each component, though finite, is not 0-255 but different for each DCT co-efficient. this is practically taken care by Huffman coding which maps these values into binary bits.
So they are valid in 'general' definition but not what you are interpreting as.


Envelope reconstruction algorithm for audio processing

I would recommend a streaming RMS detector. The standard approach for computing a streaming RMS detector is to square the input samples and then apply these to a 1st-order lowpass filter. If you want the output in dB, take 10*log10() of this quantity. If you want the output in volts, take the square root of this quantity. If Logs and square-roots are too heavy for your processor, there are low-mips ways to approximate them.
Note that RMS detection offers a good compromise between a peak detector (which is often over-responsive to very narrow transients) and average (which is sometimes too slow). Also, the ear tends to approximate RMS dynamics in its perception of loudness.


Basic sampling problem - could use some advice

You are doing it correctly.  One minor change that I would make is to divide 2.5 into 5000, not 5001, to get the sample rate.  Two reasons- one, it appears that they purposely set up the problem to have a nice, neat number.  Two, because they are implicitly saying that there was a sample at time 0 and a sample at time 2.5, so there is an "extra sample" because there is a sample at both ends, so you should subtract one.

Anyway, that is a triviality.  You got the important concepts, and that is what matters.


According to SR who posted here http://answers.opencv.org/question/18311/why-use-hue-channel-of-hsv-for-mean-shift-tracking/ the H channel in HSV

  "... is not influenced by the image brightness and saturation. You get the "pure" color disregarding the actual lighting (which might change over time)."


Doppler resolution usually depends on the dwell time $T_{dwell}$, i.e., the time for which the radar is going to stare (look) at the target. If the pulse/sweep repetition interval is given by $T_{PRI}$ then $N = T_{dwell}/T_{PRI}$ is the number of pulses/sweeps in one dwell, which is also the limit of your FFT size. Your maximum Doppler corresponds to $N/2$th bin, therefore the Doppler resolution is $f_d/(N/2)$. Note that more pulses you are able to send to the target, better is the Doppler resolution.


See my answer here on how to work with the units in question:
DFT exercise in the book Understanding digital signal processing 3 Ed
Then apply the fact that leakage does not occur when the DFT frame covers a whole number of cycles of your tone signal.

$$ Fs = 1000000 \frac{Samples}{Second}  $$
$$ Fd = 113280  \frac{Cycles}{Second} $$
$$ N = 256 \frac{Samples}{Frame} $$
$$ \frac{Fd}{Fs} \cdot N = \frac{\frac{Cycles}{Second}}{\frac{Samples}{Second}} \cdot \frac{Samples}{Frame} = \frac{Cycles}{Frame}  $$
$$ \frac{113280}{1000000} \cdot 256 =  28.99968 $$
Which is pretty darn close to a whole number.


Extended Kalman Filter (EKF) for Non Linear (Coordinate Conversion - Polar to Cartesian) Measurements and Linear Predictions

Update
If I understood your model, you have a model of Constant Velocity in 2D (Cartesian Coordinate System).
While your measurement are in Polar Coordinate System.
Pay attention that your measurement function is:
$$ h \left( x, y, {v}_{x}, {v}_{y} \right) = \begin{bmatrix}
\sqrt{ {x}^{2} + {y}^{2} } \\
{\tan}^{-1} \left( \frac{y}{x} \right )
\end{bmatrix} $$
Hence you Jacobian becomes:
$$\begin{aligned}
{J}_{h} \left( x, y, {v}_{x}, {v}_{y} \right) & = \begin{bmatrix}
\frac{\partial \sqrt{ {x}^{2} + {y}^{2} } }{\partial x} & \frac{\partial \sqrt{ {x}^{2} + {y}^{2} } }{\partial y} & \frac{\partial \sqrt{ {x}^{2} + {y}^{2} } }{\partial {v}_{x}}  & \frac{\partial \sqrt{ {x}^{2} + {y}^{2} } }{\partial {v}_{y}} \\
\frac{\partial {\tan}^{-1} \left( \frac{y}{x} \right ) }{\partial x} & \frac{\partial {\tan}^{-1} \left( \frac{y}{x} \right ) }{\partial y} & \frac{\partial {\tan}^{-1} \left( \frac{y}{x} \right ) }{\partial {v}_{x}}  & \frac{\partial {\tan}^{-1} \left( \frac{y}{x} \right ) }{\partial {v}_{y}}
\end{bmatrix} \\
& = \begin{bmatrix}
\frac{x}{ \sqrt{ {x}^{2} + {y}^{2} } } & \frac{y}{ \sqrt{ {x}^{2} + {y}^{2} } } & 0 & 0 \\
-\frac{y}{{x}^{2} + {y}^{2}} & \frac{x}{{x}^{2} + {y}^{2}} & 0 & 0
\end{bmatrix}
\end{aligned}$$
The function of the measurement is the one connecting your state vector into the measurement and not the other way around.
Let's look on Wikipedia EKF Model:

In you case $ F $ is constant is the model is linear.
What's in Wikipedia called $ H $ is the $ J $ I derived above.
Dimension wise, all is perfectly defined.
Implementation
I implemented a general Kalman Filter Iteration with support for Extended Kalman Filter (With option for Numeric Calculation of the Jacobian).
I also added option to Unsecented Kalman Filter (UKF) Iteration, so you will be able to compare.
Here is a result in with the same model as yours:

The full code is available on my StackExchange Signal Processing Q51386 GitHub Repository.
24/08/2018:
I added UKF implementation which is pretty general so you could use it in various models.
Original Answer
Converting coordinate system is the main reason the Extended Kalman Filter was invented.
Let me give you a tip, it doesn't work well in those cases.
If you use Non Linear Transformation use something that will both make things easier and better (Yea, usually it doesn't work like that, but in this case it does) - Use the Unscented Kalman Filter (UKF) which is based on the Unscented Transform.
Once you utilize that there is no need to derive the Jacobian.
All needed is to apply the non linear function $ n $ times (On each Sigma Point).
It is easy to see that linearization doesn't work well for propagating the mean and the covariance in many (Most) cases.
The UKF directly approximate the calculation of the integration of the non linear function which calculates the mean and covariance.
It will make things easier as you'll be able to skip the linearization step and only know the coordinate transformation function.
In modern tracking we usually stay away from EKF and utilize methods which better approximate the integrals of the first 2 moments propagation.
The most common ones are the UKF and GHKF (Those are called Sigma Points Kalman filters).
Their generalization is the Particle Filter which in most cases is over kill.
Update
Have a look at EKF / UKF Maneuvering Target Tracking using Coordinated Turn Models with Polar/Cartesian Velocity.
From their conclusion:

We have shown a range of coordinated turn (CT) models
using either Cartesian or polar velocity and how to use them in
a Kalman filtering framework for maneuvering target tracking.
The results of the conducted simulation study are in favor
of polar velocity. This confirms the results of the previous
study [11] and extends it to the case of varying target speed.
For polar CT models, the performance in terms of position
RMSE of the predicted state appears to be comparable for
EKF and UKF. As the UKF does not require the derivation and
implementation of Jacobians it might be more straightforward
to implement. The RMSE provided by the Cartesian velocity
EKF and UKF turned out slightly worse. Interestingly, the
sensitivity of the RMSE with respect to the noise parameters
was decreased by using EKF2 and UKF in the Cartesian case.
This, in addition to the simpler implementation and lower
computational cost of UKF over EKF2 results in a recommendation
for UKF if Cartesian CT models are preferred.

Basically telling you, don't bother with Jacobians, just use the simpler UKF.
Another comparison is made at Implementation of the Unscented Kalman Filter and a simple Augmentation System for GNSS SDR receivers with:

As can be seen, UKF implementation does not require
linearization (state transition function and measurements
functions are directly applied to sigma points) and it can
also work in presence of discontinuities. The prediction
only consists of linear algebra operations. All such
advantages are fundamental for minimizing
computational load in an SDR implementation.

While the classical Kalman Filter implies the propagation
of n components for the state vector and n2
/2+n/2
components for the Covariance matrix, the UKF requires
the propagation of 2n+1 sigma points only.

Furthermore, UKF is more insensitive to initial conditions
with respect to EKF. It has been demonstrated that UKF
rapidly converge also in presence of an initial position
error of several Kilometers.


Let me just write an answer because what I wrote above about the expectation is not correct and extremely confusing because I didn't show how the $b^2$ drops out.

By definition:

$$\operatorname{cov}(X, Y) \triangleq E(XY) - E(X)E(Y)$$

So, $$\begin{align}
\operatorname{cov}\big((X_{t+\tau} + b),(X{_t} + b)\big)
 &= E\big((X_{t+\tau} + b)(X_{t} + b)\big) - E\big(X_{t+\tau} + b\big)\times E\big(X_{t} + b\big) \\
 &= E\big(X_{t+\tau} \times X_{t}\big) + b^2 - \Big(E\big(X_{t+\tau}\big) \times E\big(X_{t}) + b^2\Big) \\
 &= E\big(X_{t+\tau} \times X_{t}\big)  - \Big(E\big(X_{t+\tau}\big) \times E\big(X_{t}\big)\Big) \\
 &= \operatorname{cov}\big(X_{t+\tau}, X_{t}\big) \\
 &= \gamma(\tau) \\
\end{align}$$

Apologies for confusion.


Feature normalization (scaling) for Hyperspectral images

There are different methods for the normalization. If it is for visual graphs, you can divide it into bands which can be defined in realtime, so you'd write a program which presents visual graphs of frequency A->B where A and B can be changed by the user. That helps you see display it graphically. using X and Y axis of the mouse to define A->B bandwidth. Then you can scan backwards and forwards through all the frequencies interactively while also normalizing them, using an amplitude meter beside the graph, to say the overall max amplitude of that bandwidth.

If the normalizing process is for high fidelity, balanced post processing and statistics, then it's best to find the highest value at any frequency and divide all the pixel amplitudes by that high value so that it equals 1.


Does oversampling improve processing gain?

You need to define what you mean by SNR and processing gain, because Marcus Muller and Qasim Chaudhari can both be considered correct depending on your definitions of SNR and processing gain. A processing gain is usually taken to be the SNR at the output of a system divided by the SNR at the input of a system. If you consider the SNR to be the signal power within the band of interest divided by the noise power within the band of interest, then there is no processing gain as you increase the sampling rate. This assumes an ideal (sinc) filter. In fact, without a perfect matched filter and perfect stopband attenuation (equal to zero), there is a processing loss caused by the out-of-band noise aliasing back into the spectrum after downsampling to the symbol rate. Although in all practical cases, this is very small and not really worth talking about. In other words, there is a fundamental limit to the SNR you can achieve by oversampling in this case. Without oversampling, it is likely that you will have poor filtering, and out-of-band noise may leak into the spectrum of interest (degrading it).

Now consider the SNR to be defined as the signal power divided by the total noise power contained in the samples (i.e. across the larger Nyquist bandwidth). In this case, you can reduce the noise level by filtering the excess noise that was added out-of-band. In other words, you will get a processing gain that is equal to the sampling rate divided by the true bandwidth of your signal (one over the baud interval for single carrier pulse shaped systems). This is often called a processing gain in ADC literature for example. Notice that if in your original samples, the matched filter design is good enough to reject out-of-band noise to negligible levels then there is no benefit in letting more noise into the system simply to reject it in order to obtain a high processing gain. It is probably worth noting that oversampling does result in a higher order matched filter which typically would result in a better stopband attenuation (making the excess noise less pronounced). This effect is very subtle and will never allow you to achieve a better SNR than you could by using a perfect matched filter (stopband attenuation = 0) at a lower sampling rate.


the importance of discrete sine transform

DCT performs close to KLT so that it is the best choice to compress highly corelated signals. For low correlated signals DST is used , check video coding standards HEVC. Therefore, one is the complement of the other, never a replacement. DCT has the DC component and DST has no DC component


Why correlation property of $\mathcal Z$-transform contains a time reversal operation

Note that (discrete-time) convolution is defined as

$$x_1[n]\star x_2[n]=\sum_kx_1[k]x_2[n-k]\tag{1}$$

and correlation is defined as

$$r_{x_1,x_2}[n]=\sum_kx_1[k]x_2[k-n]\tag{2}$$

Comparing $(1)$ and $(2)$ we see that correlation can be written as the following convolution:

$$r_{x_1,x_2}[n]=x_1[n]\star x_2[-n]\tag{3}$$

The $\mathcal{Z}$-transform of $x_2[-n]$ is given by

$$\sum_nx_2[-n]z^{-n}=\sum_nx_2[n]z^n=X_2\left(\frac{1}{z}\right)\tag{4}$$

Consequently, from $(3)$ the $\mathcal{Z}$-transform of $r_{x_1,x_2}[n]$ must be

$$R_{x_1,x_2}(z)= X_1(z)X_2\left(\frac{1}{z}\right)\tag{5}$$


The first DFT plot represents a typical case of Gibbs phenomenon.


Interpretation of a sampled signal in the frequency domain

First, $i$ is not the imaginary part, but the imaginary unit. This tells you that the signal, under suitable conditions, admits a discrete time Fourier transform.  Its is a linear representation of the discrete signal. It provides you with a spectral interpretation, ie a view of the content of the signal  as a linear combination of waves, pure frequencies  indexed by a continuous index $\omega$. Pure frequencies are cisoids or complex exponentials/sinusoids, by definition

$$e^{-i2\pi\omega nT} = \cos(-2\pi\omega nT)+i\sin(-2\pi\omega nT)\,.$$

The relative importance (weight) and "timing" of these waves is given by $\tilde{Y}(\omega)$, by its magnitude and phase, respectively. Another interpretation of the sum of products is a scalar product between the signal and the different waves. If the scalar product is high, the signal looks like the pure wave  a lot, and the corresponding frequency is very "present" in the signal. If is is low, this component is not really present in the signal. The whole spectrum, made of all the $\tilde{Y}(\omega)$, tells you about the content in "each" frequency in your data.

The two links above drive you to the excellent site of J. O. Smith, and the mathematics of the discrete Fourier transform, an perfect starting point to understand these concepts.


This is just "faking" the magnitude response of an IIR filter. The output's magnitude spectrum looks just like it has been filtered by the IIR filter with the given frequency response. Although it may somehow work, there are some limitations:

Frequency-domain filtering is usually much more computationally demanding.
It is not for real-time.

The problem with IIR filters is that they don't have linear phase and cause phase distortion. However, when the filtering is not in real-time (such as when dealing with a stored signal on a computer) there are some alternative non-causal approaches to make the IIR filter zero-phase. The most notable is forward-backward filtering which Matlab's filtfilt also uses. It actually is simple: to make the phase impact symmetric, pass the signal twice from the IIR filter, in opposite directions. After the signal passed the filter (the forward pass), time reverse it and then pass the result again through the filter. So the second (backward) pass cancels the phase impact of the forward pass. However, the magnitude response of the overall filer is the square of the frequency response of the IIR filter.