MP3 doesn't really go as high as 44.1 kHz anyway. The first step in compression filters out audio above 18 kHz, so a 36 kHz sample rate would have been sufficient. But that's not really the problem anyway. FM is analog and therefore doesn't even have a sample rate. A sample rate is the rate at which digital samples are taken.

FM does have bandwitdh, as you figured out. But the 75 kHz radio bandwidth isn't directly equivalent to 75 kHz audio bandwidth. In fact, that's the whole point of FM. AM is the modulation type for which the correspondence is a lot easier, just a factor of 2. (That's because they send the same information both below and above the center frequency, for simplicity and quality - single side band radio eliminates that factor of 2 for a slightly lower quality). But this simplicity means AM has a low audio quality - best for voice. FM uses a more robust modulation (encoding) so that the audio amplitude becomes a radio frequency change. As a result, the radio signal amplitude isn't that important anymore. And it's that amplitude which is most easily disturbed.

Effectivey you get 15 kHz audio bandwidth out of FM - a lot better than the 5 or so that AM gives you. Still, you lose about 3 kHz from the MP3 signal. In your case, that's probably just one of the causes. The limited MP3 bitrate causes some distortion, too, as does the whole digital->analog->FM path. They all add up. The easiest fix would be to obtain better quality MP3's, or a digital connection to your car sound system.


Non-decaying Harmonics in Vibration Signal

Well, looking at your time-domain signal, it looks a bit similar to a pulse train. And the Fourier Transform of a Pulse train with distance T is a Pulse train with distance 1/T

Hence, if you see a pulse every 10Hz, this corresponds to pulses every 0.1seconds in the time domain. That's what the time-domain signal looks like.


You're right that the phase plot doesn't match the signal plot. Note that it also shows more symbols than the signal plot. Those two plots do not refer to the same bit sequence, and the phase plot is only meant to illustrate the difference between QPSK and OQPSK (the original figure consists of two plots, one for QPSK and one for OQPSK).


Digital Image Processing Textbook with Specific Topics

A fundamental book on image processing for electrical engineers is

Two-Dimensional Signal and Image Proccesing_Jae S. Lim

A highly recommended one, again, for electrical engineers is

Fundamentals of Digital Image Processing_Anil Jain

A hands-on book on basic practical image procesing is

Principles of Digital Image Processing_Wilhelm Burger

If specifically looking for machine vision, then have a look at

Bernd Jahne - Digital Image Processing.


What are the different ways to find the envelope of a speech signal?

The notion of envelope is an ill-defined concept that describes the smooth upper and lower boundaries of more or less oscillating signals.

The most classical technique rectifies the signal (take the absolute value) and low-pass filters the result. Of course, results are not unique.

Other techniques identify local extrema and fit them with low-order functions like polynomials or splines. This is used for instance in some implementations of the Empirical Mode Decomposition.

The Hilbert transform sometimes offers a more solid alternative. Roughly speaking, suppose the signal can be written as the product of an envelope times an oscillation: $s(t) = e(t).o(t)$. Then, with other technical conditions, if the spectra of $e$ and $o$ are well separated, $H(s(t)) =e(t).H(o(t))$, where $H$ is the Hilbert transform. This is a loose transcription of the Bedrosian identity.

If $o(t)$ is a fine pass-band oscillations (the purest being a sine or a cosine), and $e(t)$ is lower in frequency, the Hilbert transform can separate them. This is why for speech, the signal is often decomposed first through a multirate filter bank.

All these techniques are often post-filtered in practice.

More recent approaches try to better define the regularity or smoothness of the envelope, using optimization techniques.


This is a rather late response, but I just came over this question. So if it could of any help to future problems for anyone, I will post an answer:

Although your question is pretty comprehensive; In my experience with the Lanczos filter, it is a rather versitale filter especially when it comes to image processing. I have mainly used it for scaling images, where the filter is a part of other FIR processes. To use it I would design the Sinc function(which is defined by the Lanczos resampling function) to be dependent of the following parameters: Upscale factor (N) and filter order (a). When I defined the window length it is a simple function of the two parameters which is:

k = (a * 2) + 1

and then the window space results in:

x = np.linspace(-a, a + (N-1), k*N)

where k*N is the length. The Lanczos Sinc function is then multiplied with the interval values.
This was to give a practical example. In other words, you need to know what you want to do with the filter. It is highly dependent on what you want to filter, and you need to define one (or more) parameter, besides the filter order, to define the actual window length to take full use of the filter.

To give a quick overview of the Lanczos:

It is just one of many ways to realize the Sinc function in practical terms, and it is quite good when it comes to image sharpening and interpolating between resampled discrete data points.
It does have some limitations though. If the range of values of the interpolated signal is wider than the range spanned by the discrete sample values, it can cause ringing artifacts which ultimately leads to clipping artifacts. However the effect of this is quite low compared to many other realizations of the Sinc function.


Why do we say that spectral efficiency is measured in [bit/s/Hz], not just [bit]?

The units of spectral efficiency should be thought of as (bits per second) per Hertz.  It measures the ratio of the data rate to the bandwidth.  Yes, dimensional analysis shows that the dimension is equivalent to just bits but using that simplified unit for spectral efficiency does not show what the meaning of the term is. So, it is better to use (bits per second) per Hertz as the unit, or, for those whose (US) keyboards have broken shift keys and cannot type parentheses (the ( and ) come out as 9 and 0 respectively), as bits per second per Hertz or bits/second/Hertz.  (Typing / does not need the shift key).


Amplify a signal and phase shift it by multiplying by a complex number

Multiplying by a complex number causes a rescaling by the magnitude and a rotation by the angle.  This is why when you multiply two complex numbers, you multiply the magnitudes and add the angles.

The only signal for which a complex multiplication (rescale and rotation) is the equivalent of a phase shift is a single complex pure tone (looks like a spring, or threads on a bolt).  The frequency is the translation value between the rotation amount and the shift size in the time domain.  Thus if you have a signal that is a sum of complex pure tones with different frequencies, each will be shifted by a different amount by the same non-real multiplication factor, and the sum of the shifted tones will not match a shift of the sum.

Since a real pure tone is the sum of two complex pure tones of different frequencies, it cannot be shifted by a complex scalar multiplication, nor can any sum of them.

That's all there is to it.


Normalizing the magnitude of Goertzel Filter c#

Your Goertzel code looks okay, the standard fare.

Regarding normalization and thresholds, if you're detecting 18kHz, you should calibrate your signal at different levels and establish a threshold from that data

Start with full-scale (1.0, 0dBFS) 18kHz tones, as those should give you the highest magnitude over the course of your buffer (4500 samples) and then
Repeat the Goertzel filter mag measurements on tones all the way down in level, as much as you care but I would measure at least 6dB.
Finally, run your Goertzel filter over non-tonal material, or buffers of audio that don't contain what you're looking for. This will give you an idea of what the filter will output in the non-tone case. In my application, environmental audio/speech can have incidental tones in the range I'm looking for (400-600Hz) and I want to make sure to understand what Goertzel magnitudes I would get versus Goertzel magnitudes in the presence of a real tone.


Finding the input bit rate of an analogue input

Theoretically speaking you need 2 samples per second for 1 Hz of bandwidth (regardless whether the signal is centered around DC or not), so in this case a sample rate of 1 kHz would be enough.
Practically speaking, you always need more since the theoretical requirements is based on the assumption of an ideal low pass (or bandpass) filter.
The correct choice of sample rate depends on how the band limiting is achieved and what bandwidth you are really interested in and what noise and sampling accuracy you need. Most audio systems use 44.1 kHz or 48 kHz to achieve 20 kHz usable bandwidth.
Another consideration is that you already have some digital inputs. These are derived from some master clock anyway. If you can use the same clock to sample your input, you can make the subsequent processing a lot easier.


Chroma key algorithm with unknown background color

Something self-written should be easy. "Background" probably means that the majority of pixels at the border of your image have that color.

So, just get all the border pixels, put them in an array, convert to hue and then do a histogram. Use the maximum histogram bin as your chroma key color.

Starting with border pixels of that color, erode your image on a hue gradient, i.e. make sure that the hue doesn't change too much from its neighboring pixels, and then add pixels to your background mask until you're done OR
just do classical chroma-keying and convert all pixels of colors "close enough" to that color to background mask.


why the ultasound image is noisy by speckle noise?

There are plenty of sources of noise in an imaging system. In the domain of sonar systems (which I work in) there is a big problem of reverberation, which is a fancy way of saying "sound from something that we aren't interested in. When using a sonar at sea, you get reverb from the sea surface, sea bed and the water volume. Taking volume reverb as a simple example, this is the water itself (or particles in it) returning sound to the receiver. The best way to relate to this is like driving your car on a foggy night. The sea bed and surface can absorb or reflect sound energy, depending on their composition (e.g. sea state). It's worth noting that this will bugger up your sonar image.

Another overlooked source of noise is in the signal processing itself. Your sensor is not going to be perfect and will quite happily distort both the amplitude and phase of the phenomena its trying to measure. In acoustics, you'll find microphones and hydrophones will be "tuned" for a certain bandwidth, and are quite useless outside of this frequency range. Typically your analogue to digit convertor will have some form of quantisation error with the values its spits out. It simply doesn't have the infinite precision required to represent measurements of the real world. Before we move off the subject, we should be aware that any electronics experiences interference from its  environment (e.g. induction, radiation, poor design). Add all this together and you have an estimate of what's called your "noise floor" and as a designer, you want to both minimise this by design and use other techniques to boost the signal.

Once in the digital world, your sample values are pretty much safe from additional noise. But wait there's more. In acoustics you'll want to electrically steer your array and spatially filter the incoming signal (look in different directions). This is also known as beam forming. The basic principle of beam forming is that you apply delays to the signals you receive and then sum them all together. Using the awesome power of constructive and destructive  interference, incoherent signals cancel out, and coherent signals emphasised. This isn't perfect either because the degree of spatial attenuation varies depending on a number of factors (e.g. array length and element spacing). It's worth pointing out that this aspect of processing features quite a bit of arithmetic on data types that have limited precision. Usually it's not noticeable but its there, trust me.


Removing DC offset and ensuring zero-sum for 2D filter

Removing the mean (and not the sum) from a linear filter leads to a filter that removes DC.

For example:

N = 10;
h = [0.5 1 0.5];
conv(ones(N,1), h, 'valid')

leads to 2s.

N=10
h = [0.5 1 0.5]; h_high=h-mean(h);
conv(ones(N,1), h_high, 'valid')

leads to zeros.

Alternatively, you can use any high pass filter.


How to calculate LF/HF power ratio from heart rate RR-intervals

Here is a link with a bunch of stuff relating to HVR and how to calculate various features using python discrete-heart-rate-signal-using-python-part-1. Hope it helps.


Goertzel algorithm: Relationship of magnitude

You can potentially base the threshold on the overall energy in the frame. If the tone has, say, 10% or more of the total energy, there is a good bet it's there and not just noise.

In general FFT based algorithms may not be the best choice for this. Unless your tone and your local sample clock are phase-locked, you can't line up the tone on one of the FFT bins (or your Goertzel frequency) so the energy of the tone will "smear" out over multiple frequency bins. The FFT is actually a pretty band band pass filter.

The alternative would be a time-domain band pass filter with a well defined bandwidth and steepness. This would also get rid of the framing constraint and you can dial in the time constant based on the properties of the signal rather then internal properties of the algorithm.


Let's start with the mathematical definitions.

Discrete signal power is defined as
$$P_s = \sum_{-\infty}^{\infty}s^2[n] = \left|s[n]\right|^2.$$

We can apply this notion to noise $w$ on top of some signal to calculate $P_w$ in the same way. The signal to noise ratio (SNR) is then simply
$$P_{SNR}=\frac{P_s}{P_w}$$

If we've received a noise corrupted signal $x[n] = s[n]+w[n]$ then we compute the SNR as follows

$$P_{SNR}=\frac{P_s}{P_w} = \frac{P_s}{\left|x[n]-s[n]\right|^2}.$$

Here $\left|x[n]-s[n]\right|^2$ is simply the squared error between original and corrupted signals. Note that if we scaled the definition of power by the number of points in the signal,  this would have been the mean squared error (MSE) but since we're dealing with ratios of powers, the result stays the same.

Let us now interpret this result. This is the ratio of the power of signal to the power of noise. Power is in some sense the squared norm of your signal. It shows how much squared deviation you have from zero on average.

You should also note that we can extend this notion to images by simply summing twice of rows and columns of your image vector, or simply stretching your entire image into a single vector of pixels and apply the one-dimensional definition. You can see that no spacial information is encoded into the definition of power.

Now let's look at peak signal to noise ratio. This definition is

$$P_{PSNR}=\frac{\text{max}(s^2[n])}{\text{MSE}}.$$

If you stare at this for long enough you will realize that this definition is really the same as that of $P_{SNR}$ except that the numerator of the ratio is now the maximum squared intensity of the signal, not the average one. This makes this criterion less strict. You can see that $P_{PSNR} \ge P_{SNR}$ and that they will only be equal to each other if your original clean signal is constant everywhere, and with maximum amplitude. Notice that although the variance of a constant signal is null, its power is not; the level of such constant signal does make a difference in SNR but not in PSNR.

Now, why does this definition make sense? It makes sense because the case of SNR we're looking at how strong the signal is and to how strong the noise is. We assume that there are no special circumstances. In fact, this definition is adapted directly from the physical definition of electrical power. In case of PSNR, we're interested in signal peak because we can be  interested in things like the bandwidth of the signal, or number of bits we need to represent it. This is much more content-specific than pure SNR and can find many reasonable applications, image compression being on of them. Here we're saying that what matters is how well high-intensity regions of the image come through the noise, and we're paying much less attention to how we're performing under low intensity.


How to re-program/modify sound frequencies without DSP processor?

Is it possible to still implement a program that modifies the audio frequencies (but only relying on the DSP of the host device i.e Apple, Android device), and then transmits the modified frequencies to the speaker?

I can give you an absolute, positive, definite maybe.

You absolutely positively can do digital signal processing in your cell phone's CPU -- digital signal processing is just math, and can be done in any general-purpose processor.  The only thing special about a digital signal processor is that it's heavily optimized for the sort of computation that's needed for most DSP work.

The presence of dedicated DSP chips on the market is fading these days, because general purpose processors are getting cheaper and faster in general, and because general purpose processors are getting more and more "DSP-ish" features.  So there's a good chance that a new device will have plenty of raw horsepower.

Where the "maybe" comes in is whether the phone's operating system supports doing real-time DSP on the processor, whether the processor has sufficient computational power do implement your desired algorithm, and how easy the phone's operating system makes it for an app to do the work.  The answer to the OS part of that "maybe" is a question for Stack Overflow or some other more "pure" software-engineering oriented site; the answer to the processor loading part of that "maybe" is for you to determine experimentally once you've figured out how to write an app that can diddle with the audio stream.


i would say that your reasoning is a teeny bit flawed.

the delay of an LTI filter is a deterministic function (of frequency) that is unambiguous.  a sinusoid of some known frequency goes in and the sinusoid that comes out will be delayed by a predetermined amount of time.

a median filter is not linear.  and, if a sinusoid goes in, it will not be a sinusoid coming out.  let's say that your causal median filter is outputting the median value of the current input sample and the most recent past $N-1$ samples (the "formulation" may seem "simple", but you're gonna need to repeatedly sort $N$ samples to pick out your median value), you can come up with an expected value of the delay and, since the sample that is eventually chosen to be the median value can be any one those $N$ samples with equal likelihood, then the expected value of the delay is $\frac{N-1}{2}$.


Confirmation on how to calculate phase differences at every frequency point between two wideband signals?

What you seem to want is the phase response of the device that your optical system is passing through. Based on that, your high-level approach makes intuitive sense overall; I'm not sure why you chose a Hamming window and applied it three times. In any event, though, if you have a linear discrete-time system with (complex-valued) frequency response $H(e^{j\omega})$, then:

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

where $X(e^{j\omega})$ and $Y(e^{j\omega})$ are the discrete-time Fourier transforms (DTFTs) of the input and output signals, respectively. If you express the above in polar format (magnitude and phase), then the phase response of the system is just:

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

that is, the phase response of the system just expresses the amount of phase shift that the system applies to the input signal as a function of (normalized) frequency $\omega$. Your approach takes advantage of the fact that for two complex numbers $X(e^{j\omega})$ and $Y(e^{j\omega})$:

$$
\angle Y(e^{j\omega}) - \angle X(e^{j\omega}) = \angle \left(X^*(e^{j\omega})Y(e^{j\omega})\right)
$$

So, given the DTFTs of the system's input and output signals, you can straightforwardly calculate the phase response that you seek. The devil is in the details of how one would obtain the DTFT representations of these signals. The nice part about the DTFT is that it is continuous in frequency; the bad part is that the DTFT sum is infinite in length. So, if you really want to evaluate the phase response at arbitrarily many frequencies, you better be patient, because you'll need to collect an infinite amount of data first.

The discrete Fourier transform (DFT) is often used as an approximation to the DTFT, which is valid under certain conditions. If the signals $x[n]$ and $y[n]$ are finite in length (which for a practical scenario like yours, they are), then the DFT can be thought of as evaluation of the DTFT on the finitely-spaced frequency grid $\frac{2\pi k}{N}, k = 0, 1, \ldots , N-1$ (where $N$ is the signal length). So, the larger you make $N$, the smaller your sample spacing across the frequency axis.

Most physical devices will have a frequency response that is smooth to some degree (taken with the caveat that I'm not knowledgeable on optical device physics), so you should be able to find a DFT length that gives a decent approximation to the DTFTs for the input and output signals of your system. You can then apply your approach to estimate the phase response of the device.

You noted in your question that you see incorrect results for the estimated phase response for DFT bins in the output signal that didn't contain any content in the input signal; this is to be expected. Your assumption that you would just get zero phase for those bins is not likely to hold in a practical scenario; noise present in the sampled signals, spectral leakage, or other interference can cause you to observe some small amount of energy at frequencies that you wouldn't expect it. These extraneous sources can introduce distortion between the input and output that is not due to the device's response, and for complex numbers with small magnitude, small amounts of additive noise can drastically affect the number's resulting phase.

Therefore, you can only consider the phase measurement valid at frequencies where there is significant spectral content in the input. Stated differently, if you want to make a precise phase measurement, you want high signal-to-noise ratio in the complex value that you're using to estimate the phase.


Calculating the cutoff frequency of a highpass digital filter

Concerning the cut-off frequency, there's really not much of a difference between analog and digital filters. $3\textrm{ dB}$ is common, but any other value is fine, as long as you specify it and people know what you're talking about.

In the case of the given filter, it's quite straightforward to compute any cut-off frequency. Let's choose the $3\textrm{ dB}$ cut-off frequency:

$$H(e^{j\omega})=1-\frac12\left(e^{j\omega}+e^{-j\omega}\right)=1-\cos(\omega)\tag{1}$$

Since $H(e^{j\omega})$ is real-valued and since $H(e^{j\omega})\ge 0$, we can simply solve the equation

$$1-\cos(\omega_c)=\frac{2}{\sqrt{2}}=\sqrt{2}\tag{2}$$

Note that the maximum of $H(e^{j\omega})$ is $2$, so the value of $H(e^{j\omega})$ at the $3\textrm{ dB}$ cut-off frequency $\omega_c$ is $\sqrt{2}$.

From $(2)$ we get $\omega_c\approx 1.9979$. The actual cut-off frequency in Hertz is given by

$$f_c=\frac{\omega_c}{2\pi}f_s\tag{3}$$

where $f_s$ is the sampling frequency.


The mother wavelet of your scalogram should have a similar shape to the usual peak shapes you want to detect (I suppose you use it to detect peaks of your signal).
However, I would like to ask you what would you like to use wavelets for? I could give you a more specific answer for your question.


As you correctly noted, similarity is not a rigorously defined mathematical term. However, "distance" can be defined mathematically. Quoting Wikipedia:

  In statistics and related fields, a similarity measure or similarity
  function is a real-valued function that quantifies the similarity
  between two objects. Although no single definition of a similarity
  measure exists, usually such measures are in some sense the inverse of
  distance metrics...

Here's a hand-wavy explanation, the math isn't totally precise, but hopefully it's enough to get some intuition:

Let's say we have real valued signals $x(t)$ and $y(t)$ defined on the unit interval $t \in [0,1]$. We will say that these signals are similar if the distance $||x-y||$ is small. Note that there are various choices of how to measure distance. A commonly used distance measure is the squared difference a.k.a. L2 distance defined as
$$
||x-y||^2_{L^2} \triangleq \int_0^1 (x(t)-y(t))^2 dt \ .
$$

Let's say we have three signals $x$, $y$ and $z$. Normalize all signal energies to 1 so that $\int_0^1 (x(t))^2 dt = 1,$ etc. Suppose $x$ is more similar to $y$ than $z$. This means

$$||x-y||_{L^2} < ||x-z||_{L^2}$$

or,

$$\int_0^1 (x(t)-y(t))^2 dt < \int_0^1 (x(t)-z(t))^2 dt$$

or, rearranging terms,

$$\int_0^1 x(t) y(t) dt > \int_0^1 x(t) z(t) dt \ .$$

In other words, the correlation between $x$ and $y$ is higher than that between $x$ and $z$. This shows that in order to find a "more similar" signal, maximizing the correlation is indeed the right thing to do (assuming L2 distance).


What should my reference value be when converting FFT bin amplitudes to dB?

You tagged this dbfs, so, that's basically your answer, because, yes, the output of a DFT is very much predictable!

What you choose, however, as reference amplitude is up to you to define as useful to you.  I can but make a recommendation:

Assume you're transforming a constant vector of $N$ maximum (ADC) values; that'll give you, depending on the normalization that your DFT applies, an all-0 vector with the equivalent energy in the DC-bin. That'd be a useful value for the full-scale maximum; frequency shifting and superposition with other signals can never yield a more powerful bin.


Object Classification using pyramid match kernel

The pyramid match kernel does not operate on the sets of feature vectors directly.  It operates on multi-level histograms of feature vectors. Let's say you are using the SIFT descriptors, which live in 128-dimensional space.  First you divide each dimension into 2 bins, which divides the entire feature space into $2^{128}$ bins. Then you count how many features fall into each bin.  This is the first level of your histogram.  Then you divide each dimension into 4 bins, and so on. Luckily, this histogram is going to be very sparse, so you only need to allocate the memory for non-zero bins.

You do this for the training images, and the images that you want to classify.  Then the pyramid match kernel is simply the intersection of two histograms.


There is no misunderstanding at all. The Padé approximant you found is correct.

The "problem" is that you chose $M$ and $N$ such that the transfer function you get to approximate the delay is improper. Namely, the order of the numerator exceeds the order of the denominator.

In Control Theory, improper systems are not too useful because they cannot be realized in real life. A transfer function with more zeros than poles contains pure differentiators, so the transfer function represents a system that is non-causal (assuming stability, as Matt pointed out in the comments below), and non-causal systems cannot be physically realized.


Adding White Gaussian noise to a voice signal

Your problem is how you calculate the signal power. You are calling norm which calculates $\sqrt{\sum_i |x_i|^2}$ but you want to calculate the sum of the squared values and then divide by the length as you do in your code. Try this instead:
sig_power = norm(sig)^2 / length(sig);. This line will calculate $\frac{1}{N}\sum_{i=1}^N |x_i|^2$.


Fourier-Analysis of Stationary Random Signals

assuming ergodicity...

ACF:

$$\begin{align}
R_x[k] &= \lim_{N \to \infty} \tfrac{1}{2N+1} \sum\limits_{n=-N}^{N} x[n] \, x[n+k] \\
  &= \mathbb{E}\Big\{ x[n] \, x[n+k]  \Big\} \\
  &= \sigma_x^2 \ \delta[k] \\
  &= 1\  \delta[k] \\
\end{align}$$

PSD:

$$ S_x(e^{j\omega}) = \sum\limits_{n=-\infty}^{\infty} R_x[n] \, e^{-j \omega n} $$


What does it mean to say that "sinc" filters are ideal?

An ideal filter (system) is the one which can be described mathematically but cannot be implemented (realized) physically.

Coming to a sinc filter, the ideality of this filter results from its frequency domain definition which is an ideal low-pass filter with zero ripple in the pass and stop bands and zero transition width.

Having these specifications, an ideal lowpass filter, can be described mathematically but cannot be realized using any techniques. However you can still find the resulting impulse response of an ideal lowpass filter by using the formal frequency to time transformation of the frequency reponse of the ideal filter.

This kept in mind, therefore, an ideal low-pass filter is seen to have an impulse response in the form of a sinc(x) signal, which extends from minus to plus infinity in time, which is another manifestation of the ideality of the filter being designed.

When such a filter is to be implemented in practice, it can only be approximated. The approximation being better as the length of the filter increases which however is a very undesired condition.

Instead of forcing approximations to ideal sinc filters this way, it is practically more effective to use other techniques such as weighted windowing to realize those filters, which results in the conversion of filter characteristics from those of the ideal one to the realizable one.


Finding a signals complimentary sound / frequency

Yes and no. Only monochromatic colors consist of a single wavelength, and those do not really "wrap around" in the form you describe. Color addition and subtraction have more to do with the three types of cone cells in our eyes than with wavelengths. Since there is no audio analogue to these cone cells, the concept of complimentary colors doesn't exist in the same way.

However, if you consider notes instead of frequencies, in the sense that two frequencies that are one or more octaves apart constitute the same note, then you can say that two notes are complimentary if they are a tritone apart.


When should we use the full Gabor Function and when do we use only the real part?

The real part of the complex Gabor function is symmetric. This means it will give a large response at the centre of symmetric features such as lines.

The imaginary part of the complex Gabor function is anti-symmetric. This means it will give a large response at the centre of anti-symmetric features such as edges.

The real and imaginary parts are sort of in quadrature. This means when you take the magnitude of the response to the complex Gabor filter it will be high at the location of both edge and line features, which can be useful.


Understanding PSD: Why Does Power at High Frequencies Affect Low Frequencies?

The spectrum allows you giving another complementary look on the data.
It is the other side of the same coin.

In Frequency Domain we are looking on the energy of each spectral component of our data.
Each component is independent of other component in the meaning each component is orthogonal to any other component.

In the case of White Noise, the PSD is the Fourier transform of the Auto Correlation function.
The model is Continuous White Noise is one which has infinite power.
Its power becomes finite once it is sampled by a sampling chain which has Low Pass Filter (Which the component which limits the incoming power) and AD.

Now, just like LPF will limit the power of any signal which has bandwidth which is higher the LPF bandwidth it does so to White Noise as well.

Namely, the Constant Level of the PSD is a property of the White Noise alone (In case of Gaussian White Noise it is the $ \sigma $ parameter) while the power of the sampled noise is derived by the level of the PSD and its bandwidth (Which is a property of the LPF).

There is no high frequencies which changes the values of low frequencies.
The power gets bigger because of the hidden assumption that when you sample with higher rate you use LPF with higher bandwidth which lets more frequencies in and hence more power.


How do you measure "detail" of a signal?

What you are referring to is typically known as "Image Sharpness". A quick scan, as well as some prior knowledge, comes to the following:

Fourier analysis- Using this has 2 key disadvantages. First of all, noise would tend to show up no matter what, and thus higher frequency components would tend to show up. Secondly, sharpness tends to be a local phenomena, and thus might not show up if you do a transform of the entire image.
Eigenvalue analysis- I haven't actually read this paper, but it proposes using eigenvalue analysis to determine the sharpness of an image.
Edge detection algorithms depend on a certain amount of sharpness. One could use different values for edge detection parameters to determine the amount of sharpness.
Kurtosis Measurement of wavelet coefficients- Again, I haven't read the entire paper, but this seems to suggest calculating wavelet coefficients, performing an FFT of the entire set of coefficients, and measuring the kurtosis. This should be relatively immune to noise.

I'm sure there are many more. This is a very active field of study currently. If none of these methods suits you, then continue to search through academic papers, and see if you can find a better method.


Most generally-accepted audio term, for "pre" and "post" lengths of a symmetric filter's impulse response?

That's the causal (comes after the impulse) and anticausal part.


Structure of function that describes sine signal

I think you posted similar question 3 days ago, regarding your teacher claiming that $\sin 2x$ is not a sinusoidal function. Nevertheless this function is definitely sinusoidal. Otherwise how come we can say that signals can be decomposed into sums of sinusoids (and cosinusoids)? You have plenty of orthogonal waves: $\sin x, \ \sin 2x, \ \sin 3x, \ldots$, and all of them are sinusoids.

The only thing that is coming into my mind, is that:

  Discrete-time sinusoid is periodic only if its fundamental frequency
  $f_0$ is a rational number

For a sinusoid with frequency $f_0$ to be periodic, we should have:

$$ \sin[2\pi f_0 (N+n)+\theta] = \sin[2\pi f_0 n + \theta]$$

This relations is true if and only if there exists an integer $k$ such that:

$$2\pi f_0N=2\pi k $$
or, equivalently:

$$f_0 = \dfrac{k}{N} $$

To determine the fundamental frequency of a periodic sinusoid, we express its frequency as above and cancel common factors so that $k$ and $N$ have no common divisors. Then the fundamental period of the sinusoid is equal to N.

So for example:

$f_0 = \dfrac{31}{60}$ implies that $N=60$
$f_0 = \dfrac{30}{60}$ implies that $N=2$

Thus if you define your discrete sinusoid to be:

$\sin[2 f_0 t]$, or
$\sin[\sqrt{2} f_0 t]$

then these are no longer periodic in digital domain. Why? Think of that in following way: each sample at start of the new period will be shifted slightly - it's not a rational multiple of $\pi$. Below is some plot for two signals:

$\sin [2 \pi t]$
$\sin [2 \pi \sqrt{2} t]$

Sampling frequency is $10 \ \mathtt{Hz}$ and upper time limit is $8 \ \mathtt{s} $

You can see a first sinusoid is periodic - every 10 samples (1 second) you get repeating pattern. On the contrary second one, of which fundamental frequency cannot be represented as a rational number (no way to decompose $\sqrt{2}$) periods are not the same - thus your signal has no period. Check the figure below for overlay of 11 periods:


There are several problems with your approach:

The expression $\displaystyle\frac{1+z^{-1}}{2}$ is the transfer function $H(z)$, NOT its magnitude $|H(z)|$.
Consequently, the expression $\displaystyle \frac{1+e^{-j\Omega}}{2}$ is the complex frequency response $H(e^{j\Omega})$, not its magnitude.

So now you have to compute the squared magnitude of $H(e^{j\Omega})$ and set it equal to $\frac12$. This is a basic exercise in complex numbers, so I trust that you can take it from here.
For some magical reason, the right half of you last equation is actually the final correct equation, even though everything before it is wrong. If you think about it for a while, you should figure out that the solution is given by
$$\cos(\Omega_c)=0\tag{1}$$
which certainly does not imply that $\Omega_c=0$. What is it that it does imply?


Bio-signal discontinuity after FIR filtering

You need to maintain the filter state. For an FIR filter that's fairly easy since the state are just the last $N-1$ samples if your previous input, where $N$ is the FIR filter length.
Most filter functions have a built in option for doing this. If you don't have it just do the following:

Prepend you current frame with the $N-1$ last samples of the previous frame
Run the filter
Throw away the first $N-1$ samples of the output.


How to approximate these fuzzy rectangle shapes in binary maps?

You might get better answers to this question over at Math Stack Exchange, but let me give it a try.

First of all, you should try to decide what the property that you want your rectangle to maximize actually is.  I'll take a wild guess and say that it might be the number of red pixels minus the number of blue pixels inside the rectangle.

If my guess is right (or at least a good approximation), then the first thing you probably want to do is integrate your data.  That is, let $f(x,y)$ be $1$ if the pixel at $(x,y)$ is red, and $-1$ if it's blue.  Then, for each point $(x,y)$, you want to calculate

$$ F(x,y) = \sum_{i=0}^x \sum_{j=0}^y f(i,j) \;. $$

This is easy to calculate in two passes over the data, e.g. in pseudocode:

// first pass: integrate over x for each y
for y from 0 to y_max:
    sum = 0;
    for x from 0 to x_max:
        sum = sum + data[x,y];
        out[x,y] = sum;

// second pass: integrate over y for each x
for x from 0 to x_max:
    sum = 0;
    for y from 0 to y_max:
        sum = sum + out[x,y];
        out[x,y] = sum;

or, indeed, even in just one pass:

// do first row:
sum = 0;
for x from 0 to x_max:
    sum = sum + data[x,0];
    out[x,0] = sum;

// do other rows:
for y from 1 to y_max:
    sum = 0;
    for x from 0 to x_max:
        sum = sum + data[x,y];
        out[x,y] = sum + out[x,y-1];

(The careful reader will also note that both of these code examples can be made to work in-place just by replacing all instances of out with data.)

Now, if one corner of your rectangle were fixed at $(0,0)$, all you'd need to do to optimally place the other corner would be to find the maximum of $F$.  (This can be done easily and efficiently just by looping over all points and keeping track of the maximum value seen so far and its location.)

However, if both corners can be at arbitrary locations, then things get a bit more complicated.  Essentially, what you want to maximize is

$$\begin{aligned}
G(x_1,y_1; x_2,y_2)
&= \sum_{i=x_1}^{x_2} \sum_{j=y_1}^{y_2} f(i,j) \\
&= F(x_1,y_1) - F(x_1,y_2) - F(x_2,y_1) + F(x_2,y_2)
\end{aligned}$$

where the latter formula can be derived using the inclusion–exclusion principle.

Unfortunately, while the analogous problem in one dimension is relatively easy to solve, in two dimensions it gets trickier.  If you don't have too many points, you could just loop over every possible pair of points and select the one that maximizes $G$, but the time that takes scales with the square of the number of points (and thus with the fourth power of the data resolution).

Instead, you may be better off exploiting the relative smoothness of the integrated data by first sampling $G$ at a lower resolution to find an approximate maximum, and then refining it, either just by sampling the vicinity of the approximate maximum more finely, or perhaps using simple hill cimbing.  Or you could try starting a simple hill climbing process from each low-resolution sample point to find the nearby local maximum, and then take the highest of these maxima.

(You could even consider more advanced optimization techniques, such as simulated annealing, but these may well be overkill for your purposes, and might even be less efficient than the simpler methods described above.)


formula derivation for periodic signal power

I'd like to show you a more formal derivation. Note that the first formula for arbitrary (non-periodic) signals could be rewritten as

$$P_x=\lim_{M\rightarrow\infty}\frac{1}{(2M+1)N}\sum_{n=-MN}^{(M+1)N-1}|x[n]|^2\tag{1}$$

for some integer $N\ge 1$. For $N=1$, Eq. $(1)$ is identical with the first formula in your question. If you choose $N>1$ you simply add more chunks of length $N$ (instead of length $1$) to your sum if you increase $M$.

Now assume that the signal $x[n]$ is periodic with period $N$. This means that the sum over $2M+1$ periods equals $(2M+1)$ times the sum over a single period:

$$\sum_{n=-MN}^{(M+1)N-1}|x[n]|^2=(2M+1)\sum_{n=0}^{N-1}|x[n]|^2\tag{2}$$

Plugging $(2)$ into $(1)$ gives

$$P_x=\lim_{M\rightarrow\infty}\frac{1}{(2M+1)N}(2M+1)\sum_{n=0}^{N-1}|x[n]|^2=\frac{1}{N}\sum_{n=0}^{N-1}|x[n]|^2\tag{3}$$


Kalman Filter for position : introducing acceleration estimates

If the acceleration readings are performed in an inertial (non rotating in particular) frame then yes it's sufficient to use the accelerations, but if the acceleration measurements are performed on the moving craft then no it's not possible alone by accelerometer readings.

Eventhough it's sufficient to use those accelerations $a_x$, $a_y$, and $a_z$ on a cartesian coordinate system to compute the displacement associated with the center of mass of the craft that's moving in 3D, nevertheless you will also need to know the orientation of the craft (hence the accelerometer) so that you can transform its acc measurement vectors into the navigation frame correctly.

Therefore, you also need to consider (at least) the gyroscopic readings to determine the craft orientation wrt your navigation frame. Once you determine the orienation of the craft, then you convert its current acceleration measurements into the non-rotating intertial frame in which you compute the track of the craft by integrating the accelerometer readings.


What Is the Best First Order IIR (AR Filter) Approximation to a Moving Average Filter (FIR Filter)?

OK, let's try to derive the best:
$$
\begin{array}{lcl}
y[n] &=& \alpha x[n] + (1 - \alpha) y[n - 1] \\
&=&  \alpha x[n] + (1 - \alpha) \alpha x[n-1] + (1 - \alpha)^2 y[n - 2]\\
&=&  \alpha x[n] + (1 - \alpha) \alpha x[n-1] + (1 - \alpha)^2 \alpha x[n-2] + (1 - \alpha)^3 y[n - 3]\\
\end{array}
$$
so that the coefficient of $x[n-m]$ is $\alpha(1-\alpha)^m$.

The best mean-square approximation will minimize:
$$
\begin{array}{lcl}
J(\alpha) &=& \sum_{m=0}^{k-1} (\alpha(1-\alpha)^m - \frac{1}{k})^2 + \sum_{m=k}^\infty \alpha^2(1-\alpha)^{2m}\\
&=& \sum_{m=0}^{k-1} \left(\alpha^2(1-\alpha)^{2m} - \frac{2}{k}\alpha(1-\alpha)^m + \frac{1}{k^2}\right) + \alpha^2 (1-\alpha)^{2k} \sum_{m=0}^\infty (1-\alpha)^{2m} \\
&=& \alpha^2\frac{1- (1-\alpha)^{2k}}{1 - (1-\alpha)^2} + \frac{2\alpha}{k} \frac{1 - (1 - \alpha)^k}{1 - (1 - \alpha)} + \frac{\alpha^2(1-\alpha)^{2k}}{1 - (1 - \alpha)^2}+ \frac{1}{k}\\
&=& \frac{\alpha^2}{1 - (1 - \alpha)^2} + \frac{2}{k} (1-(1-\alpha)^k) + \frac{1}{k}\\
&=& \frac{\alpha^2}{2\alpha - \alpha^2 }+ \frac{2}{k} (1-(1-\alpha)^k)+ \frac{1}{k}\\
&=& \frac{\alpha}{2 - \alpha }+ \frac{2}{k} (1-(1-\alpha)^k)+ \frac{1}{k}\\
\end{array}
$$
because the FIR coefficients are zero for $m > k - 1$.

Next step is to take derivatives and equate to zero.

Looking at a plot of the derived $J$ for $K = 1000$ and $\alpha$ from 0 to 1, it looks like the problem (as I've set it up) is ill-posed, because the best answer is $\alpha = 0$.

I think there's a mistake here.
The way it should be according to my calculations is:

$$
\begin{array}{lcl}
J(\alpha) &=& \sum_{m=0}^{k-1} (\alpha(1-\alpha)^m - \frac{1}{k})^2 + \sum_{m=k}^\infty \alpha^2(1-\alpha)^{2m} \\
&=& \sum_{m=0}^{k-1} \left(\alpha^2(1-\alpha)^{2m} - \frac{2}{k}\alpha(1-\alpha)^m + \frac{1}{k^2}\right) + \alpha^2 (1-\alpha)^{2k} \sum_{m=0}^\infty (1-\alpha)^{2m} \\
&=& \alpha^2\frac{1- (1-\alpha)^{2k}}{1 - (1-\alpha)^2} - \frac{2\alpha}{k} \frac{1 - (1 - \alpha)^k}{1 - (1 - \alpha)} + \frac{1}{k} + \frac{\alpha^2(1-\alpha)^{2k}}{1 - (1 - \alpha)^2}
\end{array}
$$

Simplifying it according to Mathematica yields:

$$ J(\alpha) = \frac{\alpha}{2 - \alpha} + \frac{2 {(1 - \alpha)}^{k} -1}{k} $$

Using the following code on MATLAB yields something equivalent though different:

syms a k;

expr1 = (a ^ 2) * ((1 - ((1 - a) ^ (2 * k))) / (1 - ((1 - a) ^ 2)));
expr2 = ((2 * a) / k) * ((1 - ((1 - a) ^ (k))) / (1 - (1 - a)));
expr3 = (1 / k);
expr4 = ((a ^ 2) * ((1 - a) ^ (2 * k))) / (1 - ((1 - a) ^ (2)));

simpExpr = simplify(expr1 - expr2 + expr3 + expr4);

$$ J(\alpha) = \frac{-2}{\alpha - 2} - \frac{k - 2{(1 - \alpha)}^{k} + 1}{k} $$

Anyhow, those functions do have minimum.

So let's assume that we really only care about the approximation over the support (length) of the FIR filter. In that case, the optimization problem is just:
$$
J_2(\alpha) = \sum_{m=0}^{k-1} (\alpha(1-\alpha)^m - \frac{1}{k})^2
$$

Plotting $J_2(\alpha)$ for various values of $K$ versus $\alpha$ results in the date in the plots and table below.

  For $K$ = 8.     $\alpha_{\tt min}$ = 0.1533333
     For $K$ = 16.    $\alpha_{\tt min}$ = 0.08
     For $K$ = 24.    $\alpha_{\tt min}$ = 0.0533333
     For $K$ = 32.    $\alpha_{\tt min}$ = 0.04
     For $K$ = 40.    $\alpha_{\tt min}$ = 0.0333333
     For $K$ = 48.    $\alpha_{\tt min}$ = 0.0266667
     For $K$ = 56.    $\alpha_{\tt min}$ = 0.0233333
     For $K$ = 64.    $\alpha_{\tt min}$ = 0.02
     For $K$ = 72.    $\alpha_{\tt min}$ = 0.0166667

The red dashed lines are $1/K$ and the green lines are $\alpha_{\tt min}$, the value of $\alpha$ that minimizes $J_2(\alpha)$ (chosen from $\tt alpha = [0:.01:1]/3;$).


How can we measure the quality of the FIR filter?

The answer can be given without being at all specific to filters. In fact, one has to answer that in terms of engineering in general:
Whenever you have alternative solutions, the only measure of quality that really matters, is fulfillment of the requirements.
So, you'll have to know what you'll use that filter for, and evaluate how well the alternatives perform with respect to that specific application. Nothing else helps you. There's arbitrarily many properties that a filter can have, and for most of them, it's not clear whether a smaller or bigger value is better, and they all are intrinsically linked to other parameters. There's no single "best" solution, all depends on the application.
So, define your application. Define how that sees performance. For example, if your FIR is used in a wireless communications system, then the FIR that makes the system have the least bit error rate might be the "highest quality" one for this one system under this specific metric that you care about. For a different system, a different FIR will be the best one.


Have you tried zero-padding your signals? By adding zeroes to the front and/or end of the signals you could make them longer than 300 samples without affecting the outcome of your analysis.

Bear in mind that with very short signals your frequency-domain resolution is going to be pretty limited, and an impulsive sound such as that you describe is likely to have a very broad spectrum. The impact this has will depend on what you plan to do with your MFCCs, but essentially, there'll be fewer of them!

Using an existing package to perform the signal processing is generally a great idea, as long as you're happy to trust it! I'd certainly encourage you to make sure you understand all the processing being carried out on your data - this will affect your ability to demonstrate that your work is trustworthy.


What Does Multi Scale Image Analysis Mean?

Multi Scale means different scale of details of the image.
It comes from the intuition that blurring image with Gaussian Blur with $ \sigma $ vanishes data which is smaller then $ \frac{\sigma}{3} $.

In practice it is similar to Multi Rate Analysis of Filters in Signal Processing.
You look at the image in frequency domain and divide its data into octaves.
This partition can be done with any LPF Filter (Yet for perfect reconstruction there is some analysis).
In Image Processing the most widely used LPF is the Gaussian Blur.

By the way this is the idea behind Wavelets as well (Intuitively, in Wavelets they create special family of filters with certain set of properties).


How can I use time-series transforms for detecting malware?

The point seems to be moot. An attacker could hide in noise. Any meaningful interpretation of the question appears to aim for temporal regularity of attacks. Maybe an attack is temporally regular, but so is users' behavior. So, there might be lots of applications for transforms in malware detection, but none of them appears to promise any insight on how to recognize or intercept it.

From a computer science standpoint i would say that ,,recognizing malware'' is akin to the problem of recognizing two functions as equal, which in general is a proof, which is not computable in any ordinary sense. It would probably amount to proving P=NP. Any ,,heuristic'' recognition of malware can be evaded that way. The only system capable of actually and reliably recognizing malware appears to be a conscious human being.


You'll need to describe the density ("kernel") with which light from different angles contributes to each (physical) pixel's amplitude. Expect something rather gaussian.

Now, shift that kernel by 0.2 pixel width, repeat. You'll find a Max-Likelihod estimator for the high-density picture simply by finding a system of equations that describe how much the values of the 5 pixel positions whose densities overlap that position contribute.

If you want a very intuitive first approach, look for the kdeplot tool of the python seaborn library. The website has a nice gallery.


Why do we use Difference RGB to grayscale function?

There are different color spaces. Each of them has different coefficients for calculating gamma-corrected luma from gamma-corrected RGB values. You have listed coefficients for calculating luma according to ITU-R BT.709, ITU-R BT.601 and NTSC color spaces. There are many others as well, like BT.2020 used in consumer TVs for Wide Color Gamut.


How is the simplified version of the Bromwich inverse Laplace transform integral derived?

I agree that the derivation is unclear, yet the final result is correct (for $t>0$, see below). There are two conditions that are necessary for the final result to be true:

$f(t)$ is real-valued
$f(t)$ is causal

The step from line 2 to line 3 in the derivation assumes that $f(t)$ is real-valued, i.e., only the real part of the integrand is considered. The last step leading to the final result assumes causality of $f(t)$, i.e., $f(t)=0$ for $t<0$.

From the third line in the derivation we have for real-valued $f(t)$

$$f(t)=\frac{e^{at}}{2\pi}\int_{-\infty}^{\infty}\left[\text{Re}\left(\hat{f}(a+iu)\right)\cos(ut)-\text{Im}\left(\hat{f}(a+iu)\right)\sin(ut)\right]du\tag{1}$$

and, consequently,

$$f(-t)e^{2at}=\frac{e^{at}}{2\pi}\int_{-\infty}^{\infty}\left[\text{Re}\left(\hat{f}(a+iu)\right)\cos(ut)+\text{Im}\left(\hat{f}(a+iu)\right)\sin(ut)\right]du\tag{2}$$

Since for causal $f(t)$ we have $f(-t)=0$ for $t>0$, we can write

$$f(t)=f(t)+f(-t)e^{2at},\qquad t>0\tag{3}$$

Consequently, adding $(1)$ and $(2)$ gives

$$f(t)=\frac{e^{at}}{\pi}\int_{-\infty}^{\infty}\text{Re}\left(\hat{f}(a+iu)\right)\cos(ut)du,\qquad t>0\tag{4}$$

And since for real-valued $f(t)$ the integrand in $(4)$ is even, we finally obtain

$$f(t)=\frac{2e^{at}}{\pi}\int_{0}^{\infty}\text{Re}\left(\hat{f}(a+iu)\right)\cos(ut)du,\qquad t>0\tag{5}$$

q.e.d.

Note that this is result is only valid for $t>0$, which is not stated in the paper you quoted. Of course, for $t<0$ we have $f(t)=0$.

Also note that instead of $(3)$ we could have written

$$f(t)=f(t)-f(-t)e^{2at},\qquad t>0\tag{6}$$

from which we can conclude that

$$f(t)=-\frac{e^{at}}{\pi}\int_{-\infty}^{\infty}\text{Im}\left(\hat{f}(a+iu)\right)\sin(ut)du,\qquad t>0\tag{7}$$

and, taking into account that for real-valued $f(t)$ the integrand is even, we get

$$f(t)=-\frac{2e^{at}}{\pi}\int_{0}^{\infty}\text{Im}\left(\hat{f}(a+iu)\right)\sin(ut)du,\qquad t>0\tag{8}$$

Comparing $(5)$ with $(8)$ we see the equivalence

$$\int_{0}^{\infty}\text{Re}\left(\hat{f}(a+iu)\right)\cos(ut)du=-\int_{0}^{\infty}\text{Im}\left(\hat{f}(a+iu)\right)\sin(ut)du\qquad t>0\tag{9}$$


I have the scatter plots for a Hamm and Tukey(0.25) windowed data. The complex data plotted from Hamm windowed forms a pattern, why?

Assuming we're looking at plots of the time domain I&Q, I'll guess that your multiplication operation is of limited bit width and is causing the quantization.

If you look at the Hamming Window in the time domain, only the central sample(s) are weighted at 1.0, with all the other weights down along a relatively smooth curve.
https://en.wikipedia.org/wiki/File:Window_function_and_frequency_response_-Hamming(alpha_%3D_0.53836).svg

If you look at the Tukey Window most of the samples are weighted at 1.0, with some samples on the edges of the window weighted along a curve. https://en.wikipedia.org/wiki/File:Window_function_and_frequency_response_-Tukey(alpha_%3D_0.5).svg


You can use matplotlib.pyplot.psd to get PSD (Power Spectral Density): it returns the values for the power spectrum and the corresponding frequencies.
As for SMA (Signal Magnitude Area) and SVM (Signal Vector Magnitude), I am not aware of their support in existing packages. They seem to be easily implementable in one-line functions though.


What is the Fourier Transform of $\DeclareMathOperator{\rect}{rect} \rect(2Bt)\cos[{\omega}_Ct + k_fm(t_k)t] $?

If you define the $\textrm{rect}()$ function according to this definition, then your result is correct.
However, there might be a problem with the definition of the $\textrm{rect}()$ function. If in your book they define that function to have unit area, then the result of the book would be correct.


Determine Phase Difference and Time Delay Between Two Pulsed Sinusoidal Signals

Pulse width and frequency alone are insufficient information to determine phase (relative to a fixed point in time or to each other) and delay.

The main difference between two equal length sinusoids with different starting phases is in the difference between their starting and ending transients.  So after estimating the time difference between the two pulse envelopes, you would have to look at how each pulse envelope starts and ends (which requires having a lot more bandwidth than narrow band frequency estimation alone needs).


Estimating degree of motion in video frames

Probably you could try optical flow with some key-points not pixels if your purpose is to estimate motion. I thing meaningful thing would count average values of keypoints, overcomes some threshhold or filter (to eliminate barelly moving keypoints). However there would be some problems with having constant amount of meaningfull keypoints (keypoints tend to dissapear over time and very little chance that same amount newly generated keypoints are on moving objects). If that is what you want. You can estimate amplitudes of moving keypoints.
Tools could be any CV library like OpenCV. Pixels are not easily trackable without being extracted as keypoints.

On the other hand if you want to estimate how much pixels moving on image and estimate movement results from codec movement compression you could extract frame by frame and ignore I type frames and count how much pixels are on B and P type frames (I am recalling from h264 not sure how these frames are expressed in vp8), which are just moving picture parts from previous/next frame. You then can have estimate how much pixels are moving. Your call how you will implement this.


Let's sum your problem. Assuming the transfer function of the whole signal transmission chain from the source 1 to the recorded signal (DAC, speaker, room, microphone, ADC...) is $h_1$ (and $h_2$ from source 2 to microphone), then the signals you have complete access too are:

$(h_1 \star x_1)(n) + (h_2 \star x_2)(n)$ (the resulting signal)
$x_1(n)$ (one of the original signals).

And your problem is that you want to recover $x_2$? Then this is the same setup as this question, and certainly not a problem of source separation - since one of the signals is already known (up to a convolution). You can get an estimate of $h_1$, and recover $h_2 \star x_2$. And if you can assume that $h_1$ and $h_2$ are similar, you can try inverting $h_2$ and get a result closer to $x_2$.

It would be a true BSS problem is you had no prior information about both $x_1$ and $x_2$, in which case it would have been intractable (unless some assumptions can be made about the way these sounds are produced - eg one of them is speech and the other is background music).


Your repetitive signal seem to be in a lower rate than the noise. I would run an FFT (why short) on all 6 sequences and filter out (zero) the frequencies that are clearly attributed to noise and then run an inverse FFT.
If you know the repetition rate you might select the one frequency that has the correct information and use the phase information to locate the desired pick. I will try to include exactly 20 cycles if possible (or 16 or 32).


Updating FFT algorithm accordingly when upsampling/resampling

Your whole problem is due to the fact that you have made a wrong assumption.

Increasing the sample rate does not increase the frequency resolution. It will increase the Nyquist frequency (the highest frequency you can represents) while keeping the same resolution. And that is exactly the phenomenon you have encountered with Matlab.

In other word, after upsampling by a factor of 10, your spectrum goes up to $2560 \text{ Hz}$, not $256\text{ Hz}$. I think you figured that out as the script you provided takes that in consideration while the figure you have posted does not.

In order to improve the resolution, you have to take a longer acquisition in time.

Your frequency resolution is evaluated as :
$$R = \frac{F_s}{N}$$
Where :

$R$ is the resolution
$N$ your number of FFT samples
$F_s$ your sampling frequency

In the script you have provided, you did increase the sampling frequency by a factor of $10$, but you also increased the number of samples by the same factor. Thus, you kept the exact same resolution of $512/90000 = 0.568 \text{Hz}$.

In order to get a better (smaller) resolution you have to:

Increase $N$ without changing $F_s$. In other word longer acquisition
Decrease $F_s$ without changing $N$. In other word longer acquisition

Hope that helps!


Advantage of using DFT and IDFT hardware for modulation

At a very high level, multi-carrier takes a single-carrier communication system that would normally need a high symbol rate, and breaks it into many constituent signals, each with their own carrier and a much smaller symbol rate.

In the original single-carrier system, the symbol period may be much less than the length of the channel impulse response, so symbols get smeared and interfere with each other.  But if you break that system into $M$ sub-carriers, then you can now get away with a symbol rate on each sub-carrier that is $M$ times smaller, or a symbol period that is $M$ times larger.  If the smaller symbol period is larger than the channel impulse response length, inter-symbol interference is no longer a problem.

The DFT just offers a way to perform multi-carrier modulation efficiently, and the IDFT likewise offers a way to perform multi-carrier demodulation efficiently.

There is a lot more to it, but that's the basic idea.


Interesting question! The only example I could easily find is this paper.

Casinovi, G., "Sampling and Ergodic Theorems for Weakly Almost Periodic Signals," in Information Theory, IEEE Transactions on, vol.55, no.4, pp.1883-1897, April 2009
doi: 10.1109/TIT.2009.2013021


How many data points are required for one revolution?

@Hustler. Hi. I suggest you use all 48000 vibration samples. As a general rule: In mathematical analysis of measured data it's preferred that you use all available data to estimate some physical quantity. If you perform 48000-point DFTs (discrete Fourier transforms) your first DFT bin frequency will be zero Hz and your DFT bin spacing will be (as jithin said) 1 Hz. Your full spectrum analysis width will be zero –to- 24000 Hz.
When you see a narrow spectral peak in your DFT spectral magnitude samples you can relate the frequency (vibrations/second) of that spectral peak to some gear in your gear box by knowing the gear's rotational velocity and how many teeth the gear has.
If you are forced to use radix-2 FFT (fast Fourier transform) software, I suggest you zero-pad your 48000 samples out to a length of 65536 samples (2^16 samples) and then perform a 65536-point FFT. In that situation the FFT spectral bin spacing will be 48000/65536 = 0.7324 Hz and your full spectrum analysis width will again be zero –to- 24000 Hz.


Design and implementation of causal band-pass filter for biosignals - what to consider?

Your bullet list makes sense and you seem to have the right idea. I think you mostly want a link that will show you how to get started, so let me suggest this.

First, start with an FIR filter. A very good FIR filter can be generated with as little as 10 lines of code, and implemented with another 10 lines of code. Basically, with FIR, if it's complicated, you are doing it wrong.

This link has source code for Windowed FIR, Parks McClellan FIR, and IIR filters, as well as code for implementing both FIR and IIR filters. Start with the Windowed FIR. They work great and are the simplest to generate.

http://www.iowahills.com/A7ExampleCodePage.html


Since you said you wanted the frequency range to be from 1 $\mu$Hz to 10 Hz, I ran my simulations with 20 Hz sampling frequency and did 100 32k FFT PSDs.  My results looked like what you have. So I lowered the sampling frequency to 0.2 Hz. The sims started at 0 s, ended at 163835 s, with $\Delta$t = 5 s. The WGN was simply unit normal. My results are shown below:

Hope this helps.


You know how to map from dBm to mW and the other way around so it seems to me this is a lossless transformation and you should be good to go by converting the dBm value to the mW value and doing the distribution fitting. You can then use it for whatever you want but just remember that you have done the conversion so will need to convert back to dB scale if that is what you want to report in the end.

Edit:
From the comment, since MATLAB is complaining about too small of values I suggest just converting to microwatts. So do:

z = 1000*z;
pd = fitdist(z, 'Rician');

If it still complained, we could just keep moving down to nanowatt and so on. As long as you know that when you use that distribution you need to keep the units straight, then there is no harm in going from dBm to mW, $\mu$W, nW, and so on.


Creating highpass from lowpass in Python

You need to line up your direc_delta with the center tap of your low pass filter. Put the 1 in the middle at N/2.


What is the Roll-Off factor of a Root Raised Cosine Filter?

Think of the root-raised cosine as a family of functions. The roll-off factor is a parameter that chooses one of the possible functions.

All root-raised cosine pulses look similar to the sinc pulse. The interesting thing about the roll-off factor is that it controls two features of the function:

The rate at which the function's lobes (or ripples) decrease. At one extreme, with roll-off set to 0, they decrease slowly (as $1/t$, with $t$ equal to time). At the other end, when the roll-off factor is 1, they decrease as $1/t^3$.
As the roll-off factor increases, so does the function's bandwith. Basically, if the function's bandwidth is $B$ when the roll-off is 0, then it becomes $2B$ when the roll-off is 1.

You can choose any value for the roll-off factor between 0 and 1, so you can select the function with the ripple and bandwidth that are best suited to your needs.


Usually the classic problem is given by:

$$\begin{align*}
\arg \min_{x} \quad & \frac{1}{2} {\left\| A x - b \right\|}_{2}^{2} \\
\text{subject to} \quad & {\left\| x \right\|}_{0} \leq k
\end{align*}$$

Where $ {\left\| \cdot \right\|}_{0} $ is the Cardinality Measure which counts the number of non zero elements in the argument.

The above is NP Hard problem which means we can only use Greedy / Approximation methods.

Since can't talk about the optimal solver the question best isn't well defined.
Usually it can be defined only once you can say something about how close you need to be to the optimal solution.

In the greedy set of algorithms the least computational demanding are those based on thresholding. Yet usually you'd use the OMP if not the LS-OMP.

On the approximation side, usually people replace the Pseudo Norm by $ {L}_{1} $. If this approximation is good for you then probably the Coordinate Descent method is the most efficient.

There is a great course on eDx - Sparse Representations in Signal and Image Processing: Fundamentals by Michael Elad which answers your exact question at on Section 3 Slides (See slide #25).


How Is the MATLAB `filter()` Function So Fast?

Actually it seems MATLAB implementation of the filter() function is pretty straight forward and not fast.

For a fast implementation, have a look at FilterM by Jan Simon.

Update

In the latest releases of MATLAB (From R2016b and above) the performance of the filter() function has improved.
The metdhos to accelerate those operations are usually based on:

Utilizing SIMD Operations (SSE / AVX in x86).
Multi Threading.
Loop Unrolling.


Sampling and Reconstructing Digital Signal

Yes, there is. You have to study a broad field in digital communication systems which is called synchronization. Generally speaking, much of the synchronization principles are the same across different parameters. Specifically, you need to implement a timing synchronization (also called timing recovery or clock recovery) subsystem in a digital receiver. You can do it in either in open loop manner (feedforward) or closed loop method (feedback, PLL based). Once you start implementing it, then you will have specific questions for which you can return to SE time and again.

In this particular example, your clock frequency is all right (bits are changing every 100ms --- a constant difference from your sampling intervals). Ideally, the output of a matched filter is sampled at the end the sampling period. Since you don't know the ideal sampling instants (maximum eye opening), you have to use either the knowledge of the data (say, a preamble), or you can use characteristics of your bitstream in a non-data-aided manner.

Edit: If you are sampling at 25ms, that makes your samples/symbol equal to 4. If post processing is not an issue, then just use digital filter and square timing recovery for the whole preamble. the closed form expression gives you an exact estimate of timing phase offset.

Then, you will have to interpolate your data according to the estimate obtained above and downsample the signal from 4:1.


Discontinuity in the angle of a complex exponential signal

That's not really a discontinuity. On a circle the two points $-\pi$ and $+\pi$ are identified: They are the same point. That is true for all $x$ and $x+n 2\pi$ for integer $n$.

If you would like to keep the continuity obvious, you might want to switch to a phasor representation of angles. Those are complex numbers on the unit circle $\exp(i\phi)$ and they form a group under multiplication. They nicely absorb the non-obvious topology of the phase angle.


Is spectral leakage due to windowing 'different' for the DTFT and DFT?

The concept of spectral leakage is not dependent on the context, and it's the same thing for the DTFT as it is for the DFT. It's probably helpful to remember that the DFT of a finite length sequence equals a sampled version of the DTFT of the same sequence:

$$\begin{align}X(\omega)&=\sum_{n=0}^{N-1}x[n]e^{-jn\omega}\qquad\text{(DTFT)}\\
\tilde{X}[k]&=\sum_{n=0}^{N-1}x[n]e^{-jn\frac{2\pi k}{N}}\qquad\text{(DFT)}\end{align}$$

Obviously we have

$$\tilde{X}[k]=X\left(\frac{2\pi k}{N}\right)$$

Now assume we have two sinusoidal signals windowed with a rectangular window such that in one case there's an integer number of periods inside the window, and in the other cases there isn't:

In both cases we get spectral leakage due to the windowing process. However, in the first case, the samples of the DTFT computed by the DFT are all at the zeros of the DTFT (except for one sample at the sinusoid's frequency). This is not the case for the second signal. That means that in the first case the DFT doesn't "see" the spectral leakage due to the sampling process, but in the other case the spectral leakage is also visible in the DFT.

These two cases are shown in the figure below. The DTFT is shown in blue, and the corresponding DFT is in red:


How to determine a very low frequency signal?

Check out this article by Eric Jacobsen and Peter Kootsookos:
http://www.ingelec.uns.edu.ar/pds2803/Materiales/Articulos/AnalisisFrecuencial/04205098.pdf

I had some success using this method for doing "sub-bin" frequency estimation when only one sinusoid is present.


Why do we really split pulse shaping between the transmitter and the receiver?

There must be something wrong in your code because it's quite straightforward to show that the squared frequency response of a raised cosine pulse does not satisfy the Nyquist criterion.

A raised cosine pulse satisfies the Nyquist criterion simply because a raised (co)sine function and an inverted raised (co)sine function add up to a constant:

$$(1+\sin(x))+(1-\sin(x))=2$$

where one of the two expressions corresponds to the rising edge of the frequency response whereas the other corresponds to the falling edge of a shifted version of the frequency response.

Now if you square the frequency response you get the following expression in the region where two shifted spectra overlap:

$$(1+\sin(x))^2+(1-\sin(x))^2=2(1+\sin^2(x))\neq const$$

which is not constant, and which proves that the squared frequency response of a raised-cosine pulse does not correspond to a Nyquist pulse.


coded filter vs fdatool : inconsistency in the results for same parameters

Note that the fdatool gives you a structure with cascaded second-order sections, whereas the fvtool uses a direct-form II transposed structure. In combination with the filter specs this results in the difference you see, because the very low cut-off frequency combined with the relatively high filter order results in a cluster of poles and zeros very close to the DC point in the complex $z$-plane (i.e., close to $z=1$). Computing the exact locations of the poles and zeros is an ill-conditioned problem, and in the case of the direct-form II transposed structure, you need to find the roots of polynomials of degree $8$. Due to the round-off errors in the computation of the roots, some of the poles appear to lie just outside the unit circle, hence the conclusion that the filter is unstable. For the second order sections, the poles can be computed more accurately and they all turn out to lie inside the unit circle, hence the conclusion that the filter is stable.

So, is the filter now stable or unstable? Well, in theory it is stable. In practice, however, it is probably of no use because its poles are virtually on the unit circle. The tool probably offers you to compute the exact pole locations of the second order sections. You'll see that most of the pole radii are very close to $1$.


Suitable signal processing techniques for frequency response functions?

I agree with all of what Dan has said, and would add that the method of excitation is probably not the best for reproducibility. Impulse hammer taps can have different frequency content depending on the location of the strike and the angle of strike, not to mention they are slow as compared to shaker excitation or using a loudspeaker (air coupled). If you're going to be amassing statistics you want to make it quick and reproducible. You can get quick FRF's with a logarithmic chirp excitation in this frequency range, I think.


Type of filter, given difference equation?

The difference equation of IIR filter is recursive, which means the current output depends upon the previous output (the output depends upon the infinite past). Your example is IIR.

On the other hand, the difference equation of FIR filter depends only upon the input. If the input is finite in duration, then the output is also finite in duration.


Confused about applying Routh Hurwitz to $s^2 +s + k$

Second order Routh Hurwitz:

$$a_0s^2+a_1s+a_2 = 0$$

$$\begin{cases}
s^2 & a_0 & a_2\\
s^1 & a_1 & 0\\
s^0 & a_2\\
\end{cases}$$

In your example

$$\begin{cases}
s^2 & 1 & k\\
s^1 & 1 & 0\\
s^0 & k\\
\end{cases}$$

Hence, $k$ should be positive.


If you have the samples of a signal of length $L$ (corresponding to 10s analog duration for example) and want to analyse its spectrum, then you can peform an $L$ point DFT/FFT on the whole data at once.

This would provide you the maximum spectral resolution but minimum temporal resolution; i.e., time locality of the events are mainly lost (or better become obscured in the phase spectrum).

If you wish to sacrifice some spectral resolution but increase the temporal instead, then you can analyse the signal in small blocks (overlapping chunks) and move the block window in time to observe the change in the local spectral behaviour. This motion of the analysis window is referred to as sliding action. And the analysis is essentially a sliding window analysis, aka short-time Fourier analysis, windowed Fourier analysis etc.

Note that for various reasons it's best to use some weighting within windowing before the DFTs are applied.


Is the zero part of a RRC filter generated signal sent?

That depends. But typically, yes, you'll flush out your transmit signal; that basically "costs" nearly nothing, but makes sure your spectral mask stays clean.

At the receiver, this part still contributes to the amplitude of the matched filter output for the last couple of symbols, so, albeit not contributing very much, omitting it would just introduce an error to these symbols.


Decimating a discrete time cosine function

The following correction of Jason R's answer completely resolves the problem: The frequency spectrum of $X_2(ω)$  consists of two components, which are scaled versions of $X(ω)$. Those are $4\pi$-periodic instead of being $2\pi$-periodic. When those $4\pi$-periodic versions are added up, the sum becomes $2π$-periodic again. THERE IS NO ALIASING or IMPULSES SUPERIMPOSED ON EACH OTHER. The derivation from
$$
X_2(\omega) = \frac{1}{2} \pi\left(\delta\left(\frac{\omega}{2}-\omega_0\right) + \delta\left(\frac{\omega}{2}+\omega_0\right) + \delta\left(\frac{\omega}{2}-\omega_0-\pi\right) + \delta\left(\frac{\omega}{2}+\omega_0-\pi\right)\right)
$$
to
$$
X_2(\omega) = \frac{1}{2} \pi\left(\delta\left(\omega-2\omega_0\right) + \delta\left(\omega+2\omega_0\right) + \delta\left(\omega-2\omega_0-2\pi\right) + \delta\left(\omega+2\omega_0-2\pi\right)\right)
$$
is not correct. Instead it must read
$$
X_2(ω)=π(δ(ω−2ω_0 )+δ(ω+2ω_0)+δ(ω−2ω_0−2π)+δ(ω+2ω_0−2π)) \qquad (∗)
$$
This is due to the scaling property of impulses
$$
δ(aω)=\frac{δ(ω)}{|a|}
$$
Then, observing that (*) is $2π$-periodic, two of the impulses are redundant and hence the DTFT of $x_2[n]=x[2n]$  becomes
$$
X_2(ω)=π(δ(ω−2ω_0)+δ(ω+2ω_0))
$$


What is the meaning of inverse signal bandwidth?

OK, now it's more clear. In a two ray model, you have tow versions of the signal; the line of sight $u(t)$, and the reflected version $u(t-\tau)$, where $\tau$ is the delay spread of the channel.

If $\tau<<\frac{1}{B_s} \simeq T_s$, where $B_s$ and $T_s$ are the bandwidth and duration of the signal, then the shift in the reflected version would be very small compared to the symbol duration. So, the LOS version would be received at time $t_0$ up to $t_0+T_s$, and the reflected version would be received at time $t_0+\tau$ up to $t_0+T_s+\tau$. But $\tau<<T_s$, and thus the two versions are received very close to each others. This answers your first question.

As for the second question, the maximum delay spread of the channel is related to something called the coherence bandwidth of the channel. Roughly speaking, the coherence bandwidth $B_c$ is inversely proportional to the maximum delay spread, in this case $\tau$. If the signal bandwidth $B_s\simeq \frac{1}{T_s}<B_c\simeq \frac{1}{\tau}$, then the channel is said to be frequency-flat fading, which means that the channel frequency response remains contact withing the signal bandwidth. In the time domain, this is translated to interference-free channel, since different symbols don't interfere with each others. On the other hand, if $B_s > B_c$, then the channel is called frequency-selective channel, as different frequency components of the signal are affected differently by the channel. In the time domain, this causes inter-symbol interference (ISI), since the maximum delay spread is larger that the symbol duration, and different symbols interfere with each others at the receiver.


What does the phase discriminator portion of the Costas Receiver do mathematically?

This pdf has the answer for you:
The short answer is that you have conflicting assumptions in number 4 above. You use the small angle approximation for sine but not cosine. If $\phi$ is small then $cos(\phi) \approx 1$. So you would end up with only $\phi$ in that term times the amplitude and $m^2(t)$. Once you integrate, or low pass filter, the signal component $m^2(t)$ for long enough that becomes basically constant and you're left with the result of something that is proportional to $\phi$. That makes the VCO advance or retard the frequency momentarily based on the phase error.
I should add that the small angle approximation generally is a good model even for when there are large errors. Generally when the error is large the error term and VCO push things in the right direction, even if the precise amount isn't perfect. Keep iterating on that and you eventually get close enough for the small angle approximation to be valid.


can measurements go out of the uncertainty bounds?

The meaning of $±3σ$ is that for a given distribution of the measurements, most of the measurements (which have values of up to three time the standard deviation around the average) will be in that boundary. By definition there will be values out side the boundary.

You need to make some specific computations to find out if in your implementation there is a deviation from your expected performance.

I wonder what is the distribution of the values you assumed? How you determine for each measurement the average and the boundaries - you have a kind of dynamic behavior which places a challenge on defining the various values.


How to detect spheres in SEM (scanning electron microscope) images?

The usual next step in such a case would be to obtain the Hough (or Radon) transform and then try to identify the spheres (or, here, circles) in the domain that results from the transform. For more information on how this works please see this link and also related response here.

However, these transforms will not improve the situation of overlapping objects. For this reason, you might also want to check two dimensional frequency domain / matched filter type (or curve-fitting) methods. For more information on this and an indicative technique, please see this paper (and potentially this one too).

A lot of work around this type of problems has been performed in biomedical engineering and specifically the problem of automatically counting blood cells (which can present themselves as ellipsoids) or detecting and automatically counting "spots" (which, again, present themselves as ellipsoids) from an analysis process called "electrophoresis". Searching for "automatic blood cell count wavelets" for example, in a relevant journal search engine, will return a very large number of results. The added benefit to potentially using wavelets here might be that you can find a wavelet mother function that closely resembles the profile of the sphere, which then gives you a better chance at detectability. For more information about this, please see this and this link, towards the end of the latter there is a link to a thesis that provides a very good summary of relevant methods.

Hope this helps.


Processing 47-53 MHz signal sampled at 96000 Hz

In short, what you're trying to do is impossible. The technique is known as band-pass sampling, or undersampling, but for it to work, you need that the signal's bandwidth be less than half your sampling frequency.

When you sample a signal with spectrum $S(f)$ and bandwidth $B$ at sampling frequency $f_s$, the sampled signal has spectrum $$S_s(f)=k\sum_i S(f-if_s)$$ where $k$ is a constant. If $B>f_s/2$ then the replicas $S(f-if_s)$ overlap and you end up with a distorted spectrum.

You are correct that the highest frequency bin in your FFT is 47906.25 Hz.


Is it possible to know the order of the filter, just looking on the pole zero plot?

Count the number of poles and zeros; if the numbers aren't the same then the larger number is the filter order. Don't forget to count multiple poles or zeros with their multiplicity. Actually, you always get the same number of poles and zeros but on a pole-zero plot you might not see them all because some could be at infinity or at the origin.

E.g., in the following pole-zero plot you see 12 zeros, 6 poles away from the origin, and a pole at the origin with multiplicity 6. So the total filter order is 12. (This is an IIR low-pass filter with approximately linear phase in the passband):


UPDATE : How to continue Computing the Convolution

Some general hints for this type of problem

If the function is defined piecewise than chances are your calculation and solution will also have to be done piecewise in sections.
Determine first where the result is zero, i.e. where $x(\tau)$ and $h(t-\tau)$ don't overlap. This determines the start and end of the sections that you need to consider. Hint: if both functions are causal than $t=0$ is always a boundary. The length of a convolution is always equal (or smaller) than the sum of the lengths of the signals.
Then find the section boundaries: these are where the mins() and maxes() changes from one argument to the other.
In each section replace the max()/min() with the correct value for this section. Solve  each section individually and splice the solutions together.

It's also super helpful if you can develop some graphical intuition for this type of problem: draw both functions with a few different overlaps and see what happens when they start overlapping, when they are fully overlap and when they stop overlapping.
You already came a long way. Give that a shot and post back if you are still stuck. Happy to help more.
EDIT
More help on the piecewise solution. For simplicity let's call the convolution $y(t)$

$y(t)$ must be zero for $t < 0$. The convolution cannot start earlier than any of the signals
$y(t)$ must be zero for $t > 3T$. The convolution cannot be longer than the sum of the length of the signal.
That means you only need to focus on the interval $0 < t < 3t$
$min(t,T)$ is  $t$ for $ 0 < t < T$ and $T$ for $T < t < 3T$
$max(0,t-2T)$ is  $0$ for $ 0 < t < 2T$ and $t-2T$ for $2T < t < 3T$

That means that you need to split the solution into three section: $[0,T]$, $[T,2T]$ and $[2T, 3T]$. Within each section, you can replace the min/max functions by the actual value since it doesn't change over the section. Example: in the first section $[0,T]$, we have $max(0,t-2T) = 0$ and $min(t,T)=t$ so you would be integrating over $[0,t]$.


How to handle edge effects with EMD (HHT)?

One possibility is to mirror the extrema near both edges with respect to the edge time values. I think this is one of the best ways to reduce edge effects. This paper explains better the way to do it.
https://www.sciencedirect.com/science/article/abs/pii/S0888327007002701
Hope this is helpful to you.


What is the significance of Z-transform?

First of all, I think you're reading the wrong books. Almost any basic text on DSP has a chapter on the $\mathcal{Z}$-transform and its significance to describe linear time-invariant (LTI) discrete-time systems. If you're looking for good (and free) books, take a look at this answer.

I will not repeat all the details you can find in those books (and in many other places), but let me just point out a few very basic things to get you started. Each (single) pole $p$ of the transfer function $H(z)$ of a causal LTI discrete-time system contributes a term

$$c\cdot p^nu[n]\tag{1}$$

to the system's impulse response, where $c$ is some constant, $p$ is the (possibly complex) pole, and $u[n]$ is the discrete-time unit step function. From (1) it is clear that this contribution only decays with time if $|p|<1$. So for a causal system to be stable we require that all the poles of the transfer function are inside the unit circle of the complex plane, i.e. they have magnitudes smaller than $1$. So if you're looking for analogies with the Laplace transform, the inside of the unit circle corresponds to the left half plane of the complex variable $s$. Furthermore, the unit circle of the $z$-plane corresponds to the $j\omega$-axis. Knowing these two things, it becomes very easy to carry over everything you know about transfer functions of continuous-time systems (Laplace transform) to the discrete-time domain ($\mathcal{Z}$-transform).


Proof of Forward Euler for discretizing a transfer function

Another way to see how the forward Euler method approximates a continuous-time system is by considering the "ideal" mapping of the $s$-plane to the $z$-plane (why?):

$$z=e^{sT}\tag{1}$$

For frequencies that are much smaller than the sampling frequency (i.e., $|s|T\ll 1$) we can approximate $e^{sT}$ by its first order Taylor series:

$$z\approx 1+sT\tag{2}$$

which is exactly the forward Euler mapping, resulting in

$$s=\frac{z-1}{T}\tag{3}$$


Usually an IQ signal is generated from a real (RF, AF, etc.) signal by a radio (by quadrature heterodyne, Tayloe demodulation, complex vector arithmetic, or otherwise).  However, if you need IQ data, and the radio only generates I (or real) component samples, a Hilbert transform can be used to generate “fake” Q components (an approximation by making some assumptions about the original signal) to use in downstream IQ processing or analysis.
Thus, if you have an IQ signal, there is rarely any need to generate another fake similar Q signal component. Just use the Q component the radio provides instead of a Hilbert transform of the I component.  An IQ signal created by a Hilbert transform of the I component contains at most half the amount of information as contained by the original IQ signal (e.g. potentially aliasing the upper and lower sidebands).
And, to get a real signal back, just reverse whatever process (superhet, etc.) the radio used to generate IQ from RF.


Why can the number of zeros be no more than the number of delay elements in a signal flow network?

There is nothing preventing you from writing down an expression that has more zeros than poles.  In fact, a typical FIR filter may be designed as something like $$\sum_{n = -\frac{N-1}{2}}^{\frac{N-1}{2}} f(n) z^n$$
giving you a filter that's nice and symmetrical around zero delay.
The problem is, that in the physical world, $z$ is a lead operator -- it fetches samples from the future.  Since physicists stubbornly refuse to invent time machines for us, we have to make do with filters that only operate on past values of the input.
Thus, we only allow $z^{-n}$, and accept $z^0$ because we have an unspoken agreement that it means "the latest sample, with just a bit of delay".


What is the forward error correction in 802.11a?

From the official standard, IEEE Std 802.11a-1999, Part 11, section 17.3.5.5 Convolutional encoder, see the rate 1/2 code:

The resulting two streams A and B are interleaved bit-alternatingly.

The other rates (2/3 and 3/4) are achieved through puncturing (as defined on the page right after).

Since this code can't deal with anything that deserves the name "burst error", which in the context of OFDM means "wideband disturbance" (in this case, "interference spanning more than 3 subcarriers" is impossible to correct reliably), there's an interleaver following this. Don't forget that in your implementation.

By modern standards, this is not an overly impressive code, to be honest.


What is the meaning of negative second for a Morlet wavelet?

Continuous wavelets with symmetric envelope are often described, by convention, on a symmetric time interval: $[-T,T]$. The Gaussian being of infinite support, this means it is truncated.

This is only a matter of convention, as the wavelet shape is translated and dilated over the whole time axis. One could thus specify as well the same wavelet on the interval $[0,2T]$.


Why discrete cosine transform may not maintain locality

In a frequency-like transformation (Fourier, discrete cosine, Walsh), one generally ends up with a sequence of coefficients that account for each frequency component over the support of the basis vector (a segment in time, a 2D patch in images). If you have a frequency component located on one half of the support, and zero the other half, or the converse, you often get the same absolute-valued coefficients. MFCCs fall in that context with:

  the short-term power spectrum of a sound, based on a linear cosine
  transform.

Information about locality can usually be traced in the phase or the sign of the coefficients, but they are difficult to read in complex situations, and are not preserved with the absolute value or the power.


finding the fundamental frequency in frequency domain

A triangle is the convolution of a rectangle against itself.  Zero padding creates a rectangular window of data.

To remove the triangle (or other windowing) artifact, you can compensate the autocorrelation of your data by using the inverse of this window overlap versus lag function.


Sharp EL-5500III (PC-1403) cassette tape encoding


HINT:

Expand the terms inside the expectation $E\{\ldots\}$, and then use the fact that the expectation of a sum equals the sum of the individual expectations (due to linearity).


Support of the convolution of two rectangular signals

We have rectangular pulses

$$H_1 (\omega) = u \left(\omega + \frac{\pi}{5}\right) - u \left(\omega - \frac{\pi}{5}\right)$$

and

$$H_2 (\omega) = u \left(\omega + \frac{\pi}{10}\right) - u \left(\omega - \frac{\pi}{10}\right)$$

and would like to convolve them. When convolving piecewise constant functions, a useful "trick" is to differentiate, convolve and then integrate. Differentiating $H_1$,

$$H_1 ' (\omega) = \delta \left(\omega + \frac{\pi}{5}\right) - \delta \left(\omega - \frac{\pi}{5}\right)$$

and, convolving with $H_2$,

$$(H_1' * H_2) (\omega) = H_2 \left(\omega + \frac{\pi}{5}\right) - H_2 \left(\omega - \frac{\pi}{5}\right) = \begin{cases} \,~~ 1, & \text{if } \omega \in \left[ -\frac{3 \pi}{10}, -\frac{\pi}{10} \right]\\ -1, & \text{if } \omega \in \left[ \frac{\pi}{10}, \frac{3\pi}{10} \right]\\ \,~~0, & \text{otherwise}\end{cases}$$

Finally, integrating,

$$(H_1 * H_2) (\omega) = \begin{cases} \, \frac{3 \pi}{10} + \omega, & \text{if } \omega \in \left[ -\frac{3 \pi}{10}, -\frac{\pi}{10} \right]\\ \qquad\frac{\pi}{5}, & \text{if } \omega \in \left[ -\frac{\pi}{10}, \frac{\pi}{10} \right]\\ \, \frac{3 \pi}{10} - \omega, & \text{if } \omega \in \left[ \frac{\pi}{10}, \frac{3\pi}{10} \right]\\ \,\, \qquad 0, & \text{otherwise}\end{cases}$$


maximum contrast using linear gery-level trasformation

If you're subtracting the minimum and stretching the maximum remaining value to be 1, you get the following:

Let $m = \min\{I(x,y)\}$ and $M = \max\{I(x,y)\}$
$$I_{\text{new}}(x,y) = \frac{I(x,y) - m}{M-m} = AI(x,y)+B $$

where $A=\dfrac{1}{M-m}$ and $B = -\dfrac{m}{M-m}$

Hope this clears it up.


Intuitive interpretation of Fourier transform in beamforming

The equations relate to how the directivity of a uniformly spaced linear array of sensors works.

Let's start with an array:

where $\theta$ is our "look" direction (where we want to steer the array), $d$ is the sensor spacing, and, for our purposes, the angles of each segment of the array are all 0 (i.e. $\theta_1 = \theta_2 = \ldots = 0$) so the array is in a straight line along the $x$ axis.

In that case, the time at which the incoming wavefront hits each sensor, $t_j$ is:
$$
t_0 = 0\\
t_1 = d\sin(\theta)\\
t_2 = 2d\sin(\theta)\\
\vdots\\
t_j = jd\sin(\theta)\\
\vdots\\
$$

The idea is that you delay each signal from each sensor by $t_j$, weight them by $v(j)$ and then sum them you'll get an array response like:
$$
a_{\rm tot}(t) = \sum_{j=0}^{N-1} v(j) \delta(t-t_j)
$$
in the time domain.

In the frequency domain, this looks like:
$$
{\cal F}\left[a_{\rm tot}(t)\right] = A_{\rm tot}(f) = \sum_{j=0}^{N-1} v(j) e^{i2\pi f jd\sin(\theta)} \tag{A}
$$

If you now assume that the speed of the incoming waves is $c = f\lambda$ so that $f = \frac{c}{\lambda}$ we get:

$$A_{\rm tot}(\lambda ) = \sum_{j=0}^{N-1} v(j) e^{i2\pi \frac{c}{\lambda} jd\sin(\theta)} \\
= \sum_{j=0}^{N-1} v(j) e^{i\pi c j \sin(\theta)}
$$
if we assume that $\lambda = \frac{d}{2}$.

This last assumption means that now our $A_{\rm tot}$ is not dependent on the frequency variable, and just shows us how the array response changes with bearing angle, $\theta$.

So, really, while the Fourier transform is used in this derivation, equations (1) and (2) in your question are not Fourier transforms themselves.

I don't believe I've directly answered your questions, but feel free to comment and see if I can remove your doubts.

  if beamforming equations are not Fourier transforms why the result of a uniformly weighted beamformer is sinc function in $\theta$ domain just like Fourier transform ? And also does this means equation 11 in the paper is wrong

So equation 11 of that paper is the same as equation (A) in what I wrote above (I just added the tag).

So, no, the equation is not wrong.

The reason there is a $\rm sinc$-like function is simply the maths of summing complex exponentials.  The function is actually not a $\rm sinc$ but a only like it for small values of the argument in the denominator.

As you can see from (4.5) in the link, it actually looks like:
$$
{\rm asinc(\omega)} = \frac{\sin(N\omega/2)}{\sin(\omega/2)} \approx \frac{\sin(N\omega/2)}{\omega/2}
$$
where the approximation only holds if $\omega/2$ is small.

  But in the formula there is $\sin(\theta)$ instead of $\theta$ how $\sin$ affects this equation?

As @Marcus says:

  using $D(\theta)$ and calling it Fourier Transform is wrong; you could use $D(\sin(\theta))$ and get away with it :)

This just means that the $\theta$ axis is scaled slightly differently and makes it more periodic. See the picture below which plots:

$\require{color}\color{black}{\bf black}$ : $\rm sinc(\theta)$
$\require{color}\color{red}{\bf red}$ : $\rm asinc(\theta)$, and
$\require{color}\color{green}{\bf green}$ : $\rm asinc(\sin(\theta))$.

R Code Below

# 30425

M <- 10
N <- 100
theta <- seq(-pi*5,pi*5,pi/N)

sinc <- sin(M*theta/2) / (theta/2)
asinc <- sin(M*theta/2) / sin(theta/2)
asinctheta <- sin(M*sin(theta)/2) / sin(sin(theta)/2)

plot(theta, sinc, col=1, type="l", lwd = 4)
lines(theta, asinc, col=2, lwd = 2)
lines(theta, asinctheta, col=3, lwd = 1)

legend(-10, 10, c("sinc()", "asinc","asinctheta"), col=c(1,2,3), lwd = c(4,2,1))


How can I graph a simulation of a FM 16 bits codification?

It's hard to tell what you're asking here, but it sounds like you have a discrete-time frequency-modulated signal with 16 bits per sample. In order to convert this to a frequency-versus-time signal, you want to demodulate the FM. One way to do this is with an FM discriminator. A digital implementation could look like this (assuming a complex input signal $x[n]$ sampled at a rate of $f_s$ Hz):

$$
x_{d}[n] = x[n]x^*[n-1]
$$

$$
f[n] = \text{atan2}\left(\text{Im}[x_d[n]], \text{Re}[x_d[n]]\right) \frac{f_s}{2\pi}
$$

This simple implementation estimates the frequency of the signal $x[n]$ using a first-order phase difference. The phase of the product $x_d[n]$ is equal to the phase difference between successive samples $x[n]$ and $x[n-1]$. This phase difference can be used as an approximation of the frequency of the signal at time $n$. To extract the phase of $x_d[n]$, we use the atan2 function, then scale it appropriately so that $f[n]$ is measured in Hz. $f[n]$ is then the estimated frequency modulation input.

Note: As I said before, this technique assumes a complex input signal. If what you have is real-valued, you'll want to convert $x[n]$ to analytic signal format first.


Sampling frequency lower than half of sampled signal frequency?

The channel frequency controls the local oscillator on your SDR which is the frequency about which it covers.  So you are receiving signals from 16KHz below 107.5MHz to 16KHz above.

The concept you want to look up is called heterodyning.  When you modulate (multiply) a signal by a sine wave you end up with two copies shifted in frequency space by the frequency of the sine wave.  So in your case, you've told the local oscillator to run at 107.5MHz which shifts the 107.5MHz carrier from the radio tower to 0Hz and to 215MHz though the high frequency version gets cut off by the low pass filter in your radio.

If you are interested in the math then if we want to shift a complex signal $X(t)$ by a frequency of $f$ we multiply by $e^{2\pi f i t}$.  $i\sin(2\pi f t) = e^{2\pi f i t } - e^{-2\pi f i t}$ where $i = \sqrt{-1}$.  So multiplying by $i\sin(2\pi f t)$ gives $X(t)i\sin(2\pi f t) = e^{2\pi f i t}X(t) - e^{-2\pi f i t}X(t)$ which is where the two copies come from.  (The multiplication by $i$ in, e.g., $i\sin(2\pi f t)$ ultimately just adds a $90^\circ$ phase shift.)