FFT of a $N$-length real sequence via FFT of a $N/2$-length complex sequence

You can use Decimation In Time (DIT) to calculate the FFT of single $N$ length sequence, using two $N/2$ sequences and combine them later on with a single butterfly.

Knowing that FFT of an even length, real sequence, can be decomposed into even and odd part as:

$$\begin{align}
\mathrm{FFT_N}(x)&=\sum_{m=0}^{N/2-1}x(2m)e^{-2\pi j k(2m)/N} + \sum_{m=0}^{N/2-1}x(2m+1)e^{-2\pi j k(2m+1)/N}\\
&=\sum_{m=0}^{N/2-1}x(2m)e^{\frac{-2 \pi j k m}{N/2}}+e^{-2\pi j k/N} \sum_{m=0}^{N/2-1}x(2m+1)e^{\frac{-2\pi j k m}{N/2}} \\
&= \mathrm{FFT}_{N/2}(x_{even})+e^{-2\pi j k/N}\mathrm{FFT}_{N/2}(x_{odd})
\end{align}$$

and the following holds:

$x_{even}(m)=x(2m)$

$x_{odd}(m)=x(2m+1)$

Now you can form the imaginary signal from both:

$$\hat{x}(m)=x_{even}(m)+jx_{odd}(m)$$
for $m=0\ldots N/2-1$

Calculate the FFT of that complex sequence:

$$\hat{X}=\mathrm{FFT}_{N/2}(\hat{x})$$

Now you can extract corresponding FFT's of both even and odd part:

$$X_{even}(k)=\frac{\hat{X}(k)+\hat{X}(N/2-k)^*}{2}$$
$$X_{odd}(k)=-j\frac{\hat{X}(k)-\hat{X}(N/2-k)^*}{2}$$

And combine them using a butterfly:

$$X(k)=X_{even}(k)+e^{-2\pi j k /N}X_{odd}(k)$$

Keep in mind that those values are for $k=0\ldots N/2-1$. The missing value for $N/2$ can be obtained knowing the symmetry:

$$X(N/2)=\frac{[\hat{X}(0)+\hat{X}^*(0)]+j[\hat{X}(0)-\hat{X}^*(0)]}{2} $$

And that gives you the final result.


Deconvolve a FIR-filter using limits? Or: Are limits distributive with the inverse fourier transform?

Integral definition

So the fourier transform (and the inverse fourier transform) are defined in terms of integrals, which are themselves defined in terms of limits.

Nope, the integrals are not just the limits of sums here. That would be true for Riemann integrals over smooth functions (try doing that difference quotient at a place where $f$ isn't continuous). It's not how the Lebesgue integral that we need to use when defining the Fourier transformation is defined.
And, especially, if you understand the DFT as a "special use case" of the continuous FT, then you have to assume periodic repetition of the signal vector you're observing.
Periodicity leads to line spectra. These are, by definition, not continuous.
So, no, your last equation isn't right.
Fourier Transform definitions
Your equations $(\text{FT})$ and $(\text{IFT})$ aren't how we write "The Fourier transformation of $f(x)$ is ...": Your left side of the equation doesn't say you're transforming $f(x)$; it doesn't mention $f$ at all!
One common way I see the "Fourier transform of $f$" (which is a function of the frequency $\omega$) being written is
\begin{align}
\mathcal{F}\{f\}(\omega)
\end{align}
and while we're at it, the right side of these equations is wrong, too: you're missing the $\omega$ (or whatever target-domain free variable you want to use) in the exponent.
Limit $l$
Now, the first two equations:
\begin{align}
\lim_{k\to 0^+} \frac{x}{k} &= \lim_{l\to \infty} l \tag{$0^+$}\\
\lim_{k\to 0^-} \frac{x}{k} &= \lim_{l\to -\infty} l  \tag{$0^-$}
\end{align}
stand a bit on their own here, because you don't explain what $l$ is meant to be, but:
The right hand side of $(\text{$0^+$})$ and $(\text{$0^-$})$ don't exist. I mean, you literally write "when we not fix $l$ to any actual value, but let it simple pine for infinity, what's the actual value?". So, that actual value then doesn't exist.
Finding a substitute value of a function in a singularity

Is my reasoning correct, or is it flawed somewhere?

Yeah, at least the way it's written down, it's mathematically flawed.
Of course, you're right from a functional analysis point of view, your quotient function simply has a couple of singularities. That's not a problem per se!
Some of these singularities can actually be solved by finding a series on the environment of that point that is equal to the quotient in all but that point, and converges, and then "fix" the value at that point. However, that puts a huge restriction on your quotient function: It needs to be holomorphic in the neighborhood of that singularity for that series to exist. Sadly, quotients of holomorphic functions are only holomorphic where the denominator isn't zero. So, bad luck going the limit route!
What you're looking for is the residue theorem! I'll really quickly outline the idea:

your quotient function is generally holomorphic, aside from a discrete set of points (where your denominator is 0 or your numerator goes towards infinity).
If a function is holomorphic, than it has the (funky) property that if you have a "disk" (a non-intertwining surface with a closed boundary)  on which it is defined, then you can fully infer the function from the values on the boundary of that disk. You might have met that, if you're an EE, used in Stoke's theorem (in electrodynamics)
So, you just define a small disk around your singularities with radius $\gamma$, and let that radius get smaller. That should define how your quotient should behave in the singularity.

Problems
The above thing is a very analytical way of describing a system. Yes, if you have an analytic description of your quotient (hint: you do, see what sampling does and how we mathematically define the DFT as finite sum over holomorphic functions), you can apply that knowledge.
The practical problem arises from the fact that your quotient is based on an observation. Observations are noisy. Where an observed quality is close to 0, the noise component becomes dominant. If you divide by that, you get a huge amplification of noise!
So, whilst nice analytically, that's not the way you want to go in the real world. That's why all the deconvolution algorithms (there's actually quite a few) apply assumptions on the system being convolved with, and minimize some error term or maximize some likelihood term.


Extracting audio from picture of time-domain signal

In general no, there is way too much information lost

If you can constrain the audio to a reasonably small corpus of songs, phrase, keywords, etc. you may be able to train a neural network to recognize the basic envelope shape. There used to be an app that was trying to do something like this, but I can't find it anymore.


In my opinion,

DSP is a tool. It is interesting in of itself but it is most interesting when used to solve real problems.

Find an application, problem, or community that interests you.

Take medical imaging as an example. Understanding the slice theorem is necessary but so is knowledge of anatomy and physiology.

If something like RADAR interests you, knowledge of RF propagation is essential.

Do you like music? You can use DSP to like it more.

Look at other books beyond  signal processing. Think about how you could use DSP in your hobbies.

Practicing DSP is about balancing function and constraints.


How to create an echo effect in audio samples?

As hotpaw2 said, you are not going to hear an echo or delay effect unless your signal changes, so you are not hearing it because you are sending in pure, unchanging signal. You might want to try sending a burst of sine waves every second or better yet a chirp or an actual recording of music or someone speaking. It will work best if you have periods of silence in your input.

Here is an explanation of how to create a delay or echo effect in c-like pseudo-code.


There are many possible methods to isolate those 2 signals.  You can heterodyne your IQ signal up or down by 25MHz by multiplying by a complex exponential of plus or minus that offset frequency, then baseband filter each IQ component separately with either a real FIR or real IIR low-pass filter.  Or you can multiply a FIR low-pass filter kernel by those same complex exponentials.  Or you can strip the poles and zeros of any canonical IIR bandpass from either the bottom or top half of the complex plane, and convert that to complex difference equation form.
Or you can use an FFT/IFFT fast convolution filter algorithm with an offset (non-complex conjugate mirrored) response.  Or just use FFTs (of the complex IQ input) of moving windows to compare the negative FFT result frequency bins against the positive half bins.  The latter is a common source for SDR waterfall visualizations.

etc.


The reason is Euler's formula, from which you get

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

and

$$j\sin(x)=\frac12\big(e^{j\omega}-e^{-j\omega}\big)\tag{2}$$

If you have symmetric or anti-symmetric coefficients, the corresponding frequency response can always be decomposed in purely real-valued cosine terms $(1)$ or purely imaginary sine components $(2)$, plus a linear phase term if the filter is not centered around $n=0$.

Take as a simple example a filter of length $N=5$ with filter coefficients

$$\mathbf{h}=\big[1, 2, 3, 2, 1]\tag{3}$$

starting at index $n=0$. The corresponding frequency response is

$$\begin{align}H(e^{j\omega})&=1+2e^{-j\omega}+3e^{-2j\omega}+2e^{-3j\omega}+e^{-4j\omega}\\&=e^{-2j\omega}\big[e^{2j\omega}+2e^{j\omega}+3+2e^{-j\omega}+e^{-2j\omega}\big]\\&=2e^{-2j\omega}\big[\cos(2\omega)+2\cos(\omega)+3\big]\tag{4}\end{align}$$

Since the last term in brackets is purely real-valued, $H(e^{j\omega})$ has a linear phase response $\phi(\omega)=-2\omega$.

For even-length filters you get an additional delay of half a sample, and for anti-symmetric filters there's an additional phase shift of $\pi/2$ due to $j$ on the left side of $(2)$.

Also take a look at this answer discussing the four types of linear phase FIR filters.


Why does this Moiré pattern look like this?

You'll need to understand the sampling theorem. In short, each signal has what we call a spectrum¹, which is the Fourier transform of the signal as it comes in time domain (if it is a time signal), or spatial domain (if it is a picture. Since the Fourier transform is bijective, a signal and its transform are equivalent; in fact, one can often interpret the Fourier Transform as change of basis. We call that "conversion to frequency domain", since the Fourier transform's values for low ordinates describe the things that change slowly in the original (time or spatial) domain signal, whereas high-frequency content is represented by Fourier transform values with high position.

Generally, such spectra can have a certain support; the support is the minimal interval outside of which the spectrum is 0.

If you now use an observing system whose ability to reproduce frequencies is limited to an interval that is smaller than said support (which often is infinite, by the way, and always is infinite for signals that have finite extension in time or space), you can not represent the original signal with that system.

In this case, your picture has a certain resolution – which is, in the end, the fact that you evaluate the value of your function at discrete points in a fixed, non-infinitesimal spacing. The inverse of that spacing is the (spatial) sampling rate.

Thus, your picture cannot represent the original signal – it's simply mathematically impossible that the mapping of underlying function to pixels is truly equivalent to the original function, since we know that in this case, the total range of frequencies representable by your evaluation at discrete points ("sampling") is half the sampling rate, and thus, something must go wrong with the part of your signal's spectrum that is above half the sampling rate.

What happens is, in fact, that the spectrum gets aliases – every spectral component at a frequency $f_o \ge \frac{f_\text{sample}}{2}$ gets "shifted" down by $n\cdot f_\text{sample},\, n\in \mathbb Z$, so that $|f_o-nf_\text{sample}| <  \frac{f_\text{sample}}{2}$. In effect, that leads to "structure" where there (feels like) shouldn't be some.

Take the "large" structures from your picture that I've painted green:

It certainly looks like there is low-frequency content here - but in reality, it's just the high-frequecy content at frequencies $>\frac{f_\text{sample}}2$ that got aliased to low frequencies, since it was close to an integer multiple of the sampling rate.

So, yes, you can predict the artifacts that happen to a 2D signal when being sampled by comparing its Fourier transform to the bandwidth offered by the sampling rate.

¹ this might be different from the spectrum as used in linear algebra to describe the Eigen-properties of operators.


How to reprocess SDR data to be equal to that captured with a higher RBW

Max-hold would not be the best data to work with since it represents the peak envelope instead of the average power at each bin. If working with post-detection data captured from a spectrum analyzer, even with max-hold off there are additional but smaller correction factors which are only of concern if an accurate noise measurement is desired. For those cases, I linked an app-note with further details at the very bottom of this post.
Ideally the OP has access to the time domain data, in which case windowing the data would result in the equivalent of a wider resolution bandwidth (RBW), and be a simple approach for proceeding with reasonable ranges for the increase in RBW. If not, the equivalent operation on the frequency samples can be done using a circular convolution with the Kernel of the time domain window (the Discrete-Time Fourier Transform of the window).
A Gaussian window would likely approximate that used for most spectrum analyzer measurements, but a DPSS window would be optimum for minimizing time-bandwidth product (as desired for spectrum analyzers) given finite measurement intervals, or the Kaiser window which is very close to the DPSS minimum. For further details on that see this post on emulating a Spectrum Analyzer and detailing the window choices further:
Classical spectrum analyzer model
These other related posts on resolution bandwidth and equivalent noise bandwidth with windowing may be of additional interest:
Find the Equivalent Noise Bandwidth
How to calculate resolution of DFT with Hamming/Hann window?
Additionally the SDR's assumed resolution bandwidth and the increase in RBW can be confirmed by computing the autocorrelation using the frequency results before and after the additional processing, assuming the captured signal itself is reasonably white noise within the sampling bandwidth.
See page 6-8 of this app note (App Note 1303, old HP)  for further details on additional corrections up to 2.5 dB when using the log power or lin power measurements from a spectrum analyzer in order to get "true-rms" power measurements assuming noise floors as limited by Additive White Gaussian Noise (AWGN).


How can output sequence be equal to the sum of copies of the impulse response, scaled and time-shifted signals?

One interpretation of your question could be as follows:

  Given that a system has the following two properties:

  the scaling or homogeneity property that if the response to input $x(t)$ is output $y(t)$, then for any choice of $\alpha$, the system response
  to scaled input $\alpha\cdot x(t)$ is scaled output $\alpha\cdot y(t)$,
  the time-invariance property that for all choices of $\tau$,
  the response to time-delayed
  input $x(t-\tau)$ is time-delayed output $y(t-\tau)$,

  then why does the system have the additivity or superposition property
  that the response to input $x_1(t)+x_2(t)$ is
  $y_1(t) + y_2(t)$ where
  the system response to $x_i(t)$ is $y_i(t)$, $i = 1,2~$ ???? $~~~~~~~~~~~$
  More generally, why is the system response to input
  $\alpha\cdot x_1(t-\tau_1) +  \beta\cdot x_2(t-\tau_2)$
  given by $\alpha\cdot y_1(t-\tau_1) +  \beta\cdot y_2(t-\tau_2)~$?

The answer is that a system with properties 1 and 2 does not
necessarily have the additivity or superposition property.
If the superposition property also holds, then the system
is called a linear time-invariant system. But this is an
additional assumption that you need to make (or prove).

Commonly, homogeneity and additivity are combined together
into the linearity property that says that the response
to input $\alpha\cdot x_1(t)+\beta\cdot x_2(t)$ (that is,
a linear
combination of inputs $x_1(t)$ and $x_2(t)$) is
$\alpha\cdot y_1(t) + \beta\cdot y_2(t)$
(that is, the same linear combination of outputs $y_1(t)$ and $y_2(t)$).

A couple of points that should be tucked away into the
back of one's mind:

A system can be linear without being time-invariant (e.g.
a modulator $x(t) \to x(t)\cos(\omega t)$, or
time-invariant without being linear (e.g. a square-law
circuit $x(t) \to [x(t)]^2$
A additive system which produces output $y(t) + y(t) = 2y(t)$
in response to input $x(t) + x(t) = 2x(t)$ and so seems
to have the scaling property does not in fact have the
scaling property. Persuade yourself that this is true by
attempting to prove that the response to $0.5x(t)$ is
$0.5y(t)$. In short, scaling and additivity are two
different properties and a system that enjoys one of them
does not necessarily enjoy the other.

A second interpretation of your question could be as follows:

  For a linear time-invariant system, the output is supposed
  to be the sum of scaled and time-delayed versions of the
  impulse response, but I don't see how this is so. For example,
  the standard convolution result (for discrete-time systems)
  says
  $$y[n] = \sum_m x[m]h[n-m]$$
  where $h[\cdot]$ is the impulse (or unit) response of the
  system. But this seems to be completely backwards since the
  impulse response is running backwards in time (as in $-m$
  in the argument of $h$ in the above formula
  compared to $x[m]$ in which time is running forwards.

This is indeed a legitimate concern, but actually the
convolution formula is very successful in concealing
the result that the output is the sum of scaled and time-delayed
versions of the impulse response. What's going on is as follows.

We break down the input signal $x$ into a sum of scaled
unit pulse signals. The system response to the unit pulse signal
$\cdots, ~0, ~0, ~1, ~0, ~0, \cdots$ is
the impulse response or pulse response
$$h[0], ~h[1], \cdots, ~h[n], \cdots$$
and so by the scaling property the single input value $x[0]$,
or, if you prefer
$$x[0](\cdots, ~0, ~0, ~1, ~0,~ 0, \cdots)
=  \cdots ~0, ~0, ~x[0], ~0, ~0, \cdots$$
creates a response
$$x[0]h[0], ~~x[0]h[1], \cdots, ~~x[0]h[n], \cdots$$

Similarly, the single input value $x[1]$ or creates
$$x[1](\cdots, ~0, ~0, ~0, ~1,~ 0, \cdots)
=  \cdots ~0, ~0, ~0, ~x[1], ~0, \cdots$$
creates a response
$$0, x[1]h[0], ~~x[1]h[1], \cdots, ~~x[1]h[n-1], x[1]h[n] \cdots$$
Notice the delay in the response to $x[1]$.  We can continue further
in this vein, but it is best to switch to a more tabular form
and show the various outputs aligned properly in time. We have
$$\begin{array}{l|l|l|l|l|l|l|l}
\text{time} \to & 0 &1 &2 & \cdots & n & n+1 & \cdots \\
\hline
x[0] & x[0]h[0] &x[0]h[1] &x[0]h[2] & \cdots &x[0]h[n] & x[0]h[n+1] & \cdots\\
\hline
x[1] & 0 & x[1]h[0] &x[1]h[1] & \cdots &x[1]h[n-1] & x[1]h[n] & \cdots\\
\hline
x[2] & 0 & 0 &x[2]h[0] & \cdots &x[2]h[n-2] & x[2]h[n-1] & \cdots\\
\hline
\vdots & \vdots & \vdots & \vdots & \ddots & \\
\hline
x[m] & 0 &0 & 0 & \cdots & x[m]h[n-m] & x[m]h[n-m+1] & \cdots \\
\hline
\vdots & \vdots & \vdots & \vdots & \ddots
\end{array}$$
The rows in the above array are precisely the scaled and
delayed versions of the impulse response that add up to
the response $y$ to input signal $x$.
But if you ask a more specific question such as

  What is the output at time $n$?

then you can get the answer by summing the $n$-th column to get
$$y[n] = x[0]h[n] + x[1]h[n-1] + x[2]h[n-2] + \cdots + x[m]h[n-m] + \cdots
= \sum_{m=0}^{\infty} x[m]h[n-m],$$
the beloved convolution formula that befuddles generations of students
because the impulse response seems to be running backwards in time.


Techniques for variance stabilizing? Filtering Poisson noise?

Here is the link explaining variance stabilizing transform.

Some papers on Poisson noise removal

Efficient gradient projection methods for edge-preserving removal of Poisson noise
Wavelets,Ridgelets and Curvelets for Poisson Noise removal(Anscombe transform is used here)
Unsupervised Non Local Means for Poisson Noise

Similar question has been asked before: How to remove Poisson and Gaussian Noise?


How to plot Full spectrum with negative frequencies

Take the fft of x+i*y.

The phase angles in the picture you linked https://drive.google.com/file/d/0Byib6yrCQ9vnRUM2Yi1sMklXeFk/view are from the result of this fft.

The image linked have an error, from the article it came from, where the phases of the negative frequencies of the fft result are Beta. The image uses Alpha in the negative and positive results. In the end, the image just shows mathematical prove that the amplitudes of the fft are derived from the amplitudes of the individual signals.

The fullspectrum process is simple as the fft of x+i*y. The majoraxis of an ellipsis of one frequency will be the sum of the R+ and R-, and the direction will be the (Alpha+Beta)/2.

This paper could clarify it more "Use of directional spectra of vibration signals for diagnosis of misalignment in rotating machinery"


Detection of Troughs and Notches in a PPG Signal

Have you tried finding where the derivative of your signal is 0 (or crosses between positive and negative values)?

Simple, approximate, derivative filters are the first difference:

$y[n] = x[n] - x[n-1]$

and the central difference:

$y[n] = x[n] - x[n-2]$

You'll have to compensate for filter delay when mapping the zero crossings of the derivative back to the local minima and maxima of the original signal.
For the first difference, the output is delayed by about half a sample period, and for the central difference, the output is delayed about a sample period.


Comparisons of FIR Causal filters of type HRIR in Discrete Time and Frequency Domains

These are the figures of filtering at certain times in Discrete Time and Frequency Domains


Is it possible to make 3D point cloud with RADAR?

A point cloud is related to how data is acquired and stored.  One can usually transform between point clouds and rasters and say, since they can be be used in similar ways, the answer is essentially yes.  The most similar type of RADAR to a LIDAR point cloud is a Synthetic Aperture RADAR which is just called SAR.

and contrast it with a LIDAR Image , centered on the same place.  This might not be the best comparison but adequate for a 3 minute Google search.

clearly LIDAR has higher resolution.  The SAR image is formed from a coherent process of data acquired over a scan. LIDAR points are one time, travel time shots.  Each measurement adds a point.  I'm not aware of coherent LIDAR processing but I'm not State of the Art LIDAR researcher.  Doppler has an effect on the phase of the signal, and an incoherent energy detector is insensitive to phase.  You could take a SAR image and turn it into something like a point cloud but the way the data is collected and processed is different, so maybe your answer is no.

LIDAR, used like this are usually looking down over a narrow range of angles under the aircraft. SAR can more offset over a wider range of angles.  The SAR image is probably from a single flight path.  A LIDAR Image of the same extent would take a number flight paths.  One can use SAR in orbit.  I'm not sure about LIDAR through a lot of atmosphere.

SAR will probably have the advantage with respect to transmission power for some time.

The highest resolution global digital elevation maps that are publicly available are derived from SAR data.

https://en.m.wikipedia.org/wiki/Shuttle_Radar_Topography_Mission

LIDAR derived elevation data is growing.

requested edit:

A raster is a regular sampling, like uniform sampling.  Each point in a SAR image is produced by a calculation involving data that was collected over a time window, that for a pulsed waveform, would span multiple pulses. One needs to select those solution points.  Adjacent solution points overlap in the raw collected data input to the calculation.  SAR raw data can include polarization.

A point cloud is a set of individual measurements and the points aren’t regularly spaced.

SAR is a interferometric or coherent processor. SAR has some history to it and was first processed using analog processing.  Digital processing is the norm today.

Im not familiar with coherent Lidar but the term heterodyning, in my experience is analog processing. Cloud sampling isn’t a necessary theoretical requirement for Lidar.  The article that is cited in the comment speaks of continuous wave coherent Lidar which would seem to me a raster sort of sampling.

Addressing what one can do that the other can’t,  has categories like can’t now, and can’t never.  The can’t now category shifts with technology. The can’t never ignores the possibility of an ultra Wideband, ultra agile, hybrid system.

The missing comparison to Lidar is stereo vision and even in that case, they aren’t mutually exclusive.


Is it possible to detect or localize movement of objects using LPWA (or LPWAN) such as LoRa, DASH7, NB-FI?

Yes, the Doppler effect applies to any electromagnetic wave. No matter whether that is an actual Radar pulse, or a microwave oven falling from an office tower, or a passenger aircraft's transponder, or an LPWAN device.

But, this possibility is especially limited for LPWAN devices, as I'll explain below.

Low Doppler shift due to low carrier frequency

The higher the frequency, the more Doppler, and for some reason you picked particularly low-frequency standards, all operating 1 GHz, making the Doppler shift you get smaller, compared to other uncertainties like local oscillator frequency errors of the typically cheap devices.

Need for Frequency estimation

Short pulses make estimation hard

There's a basic mathematical truth that for a frequency estimate to be fine, you need a long observation, and conversely, for a time estimate to be fine, you need a large bandwidth.

Now, these standards use short transmissions, bursts, because the batteries won't allow them anything else. So that severely limits the time, or energy, you get to estimate frequency. Since you probably don't know in which general direction your LPWAN devices are moving, you'd want an unbiased estimator. Armed with a relatively simple SNR number, you can plug that in to the Cramer-Rao Lower Bound to see how good your frequency estimator of choice will get. And from that it's just multiplication with the speed of light to get the speed estimate variance lower bound. You probably won't like the results.

Cheap devices with no ongoing network registration have bad frequency accuracy

For Doppler estimation to work, you need to be able to estimate the frequency shift of a device. To achieve that, either the device needs to transmit at a very precisely known frequency, by either having a very good oscillator itself, or by "learning" the right frequency from a base station.

Both principles are pretty much impossible for LPWAN devices; they need to be cheap and low-power, so no high-quality oscillator that could run continuously. Also, no "waking up, synching to a base station, correcting the frequency offset one has by complicated algorithms, sending three bytes, going back to sleep", so also the second option is out.

Location estimates hampered by low bandwidth

So, in absence of good transmit frequency knowledge, you could simply observe the same transmitter from multiple points and estimate the speed of movement and the direction through getting enough equations to compensate for the unknowns, right?

Yes. In essence, you'd be building the "inverse" of GPS. Problem: GPS is especially designed to make getting the pseudorange and frequency estimates possible. It sends a relatively wideband, pseudo-white sequence, to make it easy to estimate a sharp crosscorrelation peak.

Your systems are designed to be narrowband and pretty much invariant to static frequency shifts, and hence (see point "short pulses..." above) do not allow for accurate time or frequency recovery.

You basically always run into the fact that these are the worst signals for frequency and/or location detection.

General remarks

I've never heard of DASH7 and NB-FI, but realize the first is just an abused RFID standard, and the second exists as invention of a single company, like there's dozens of companies who just wanted to grab some cash on the IoT goldrush, so honestly, probably not the relevant standards in the future.


Choosing the length of a signal when calculating the FFT

Mai,

The length of the FFT depends on what application you are doing. A very course summary follows:

Same size FFT:

Analysis: This just means you want to 'analyse' the signal - look and see what type of spectrum it has, maybe patterns in the spectrums, etc. The 'usual' default is to simply use the FFT length equal to the length of your signal. Example: "What is the frequency content of my signal look like?"z = abs(fft(x));
Circular convolution: In circular convolution, you want to convolve two signals circularly, as opposed to 'normal' linear convolution. So if you have a signal $x$ of length $L$, and you want to circularly convolve with signal $y$ of length $L$ also, you can multiply their same length FFTs with each other, and then take the IFFT. Example: "What is the circular convolution of $x$ and $y$?"
z = ifft(fft(x).*fft(y))

Different Length FFT:

Analysis: You can also use different (bigger) size FFTs for analysis as well. For example, if your signal $x$ was of length $L$, you can still analyze its frequency content choosing an FFT size of length, say, $10*L$. If you do this, you are actually interpolating the frequency spectrum. This just means that the spectrum looks more 'smooth', and in some cases you are able to better see where peaks might exist. Importantly though, this is not the same as increasing your frequency resolution. If someone tells you to "increase frequency resolution by taking a bigger size FFT", tell them they are wrong, and that this just interpolates the frequency domain. (Unless of course that person is your boss in which case you have to solve the non-linear optimization problem of telling them they are wrong without actually telling them they are wrong :-) ). (To actually increase frequency resolution, you need to have more samples of your original time domain signal). Anyway, the example motivation for this might be: "We analyzed our time domain signal using same size FFT, but we want to make sure the peaks we see are in the correct positions, let us increase the size of the FFT by 5 times".
z = abs(fft(x,5*length(x)));
Linear convolution: In this case, you have to use a different size FFT. In linear convolution, a signal $x$ is convolved with a signal $y$. You might have heard that "Convolution in time is the same as multiplication in the frequency domain". This is true, but with the very important and often under-stated caveat that to do linear convolutions in the frequency domain, you have to make sure the FFT sizes are correct.

The correct size of the FFT lengths for a linear convolution, is $N_{\text{fft}} = L_x + L_y - 1$, where obviously those lengths correspond to the length of your signals $x$ and $y$. Why is this the case? Because in linear convolution, the result of convolving two signals is always equal to the sum of their lengths, minus 1. Do it on paper and you will see. Convolve a signal of length 3, and another of length 2. The result will be of length 4.

And so, as an example, one might say: "I want to linearly convolve two signals in the time domain, but I want to do this operation in the frequency-domain." They might do it like this:
Lx = length(x);
Ly = length(y);
Nfft = Lx + Ly - 1;
z = ifft ( fft(x,Nfft) .* fft(x,Nfft), Pfft);

Hope this helps.


Combination of accelation signals from two devices

May be you can find variance of acceleration along x,y, and z direction in SET A and in set B separately and choose the the device which has least variance.

As this Wikipedia page suggests, you can combine the two by weighting by their respective variances.

So, to get $x_C$ simply:
$$
x_C = \frac{1}{\sigma_1^{-2} + \sigma_2^{-2}} \left(  \frac{x_A}{\sigma_1^2} + \frac{x_B}{\sigma_2^2}\right)
$$

Putting some numbers on this, suppose $\sigma^2_1 = 1$ and $\sigma^2_2 = 0.5$, then
$$
\sigma_3^2 = \frac{1}{\sigma_1^{-2} + \sigma_2^{-2}} = \frac{1}{1 + 2} = \frac{1}{3}
$$
which is a lower variance than either of the individual measurements.

Use the same process to find $y_C$ and $z_C$.


Calculating filter coefficients of a Moving average with error correction

Simply add a compensating gain at the output of your recursive moving-averaging. This compensating gain can be updated on the fly.

Adding an varying input gain at the input of the recursive implementation would also work, but it would take more time for the gain change to be effective, it would take "N" samples for the change to be applied 100% where N is the tap length of your moving-average.


How left out down-sampling in 3D-DWT just on the Z direction

You are applying a 3D DWT scheme whose down-sampling is coherent across the three  directions. Nothing forbids you from decomposing bands the way you want, and the literature is full of so-called isotropic, Tensor, Separable, Square or Standard implementations (vocabulary: separable/non-separable,
standard/non-standard, S-form/NS-form, rectangular/square, anisotropic/isotropic, tensor/Mallat, hyperbolic/isotropic, separated/combined wavelet transform)

To do that, it is more appropriate to perform 1D wavedec passes your own way on each direction separately.


The discrete-time Fourier transform (DTFT) is just what it is, regardless of the length of the signal:

$$X(\omega)=\sum_{n=-\infty}^{\infty}x[n]e^{-jn\omega}\tag{1}$$

For finite length signals you just have to sum over finitely many elements in $(1)$, which means that the DTFT always exists. This is not necessarily the case when the signal's length is infinite, because then the sum in $(1)$ does not necessarily converge.


How to Describe the Color of an Image Patch?

Another approach which might be appropriate in your Bayesian approach (Filter Particle) would be Mean Vector + Covariance Matrix.

Even for that you could employ your idea of weighing (Which is reasonable).

I would pay attention to the color space you're working in.
Euclidean Distance isn't working (At least not well) in RGB.

Example in CIE LAB

The mean is given by:

$$ {x}_{c} = \frac{1}{n} \sum_{i = 1}^{n} {p}_{i} $$

Where $ {p}_{i} \in \mathbb{R}^{3} $ is the vector of LAB valus of each pixel from a patch of $ n $ pixels.

The Covariance is given by:

$$ {C} = \frac{1}{n} \sum_{i = 1}^{n} {\left( {p}_{i} - {x}_{c} \right)} {\left( {p}_{i} - {x}_{c} \right)}^{T} $$


Convert 96 Khz to 48 Khz audio: is this simple downsampling method ok?

Since you have already properly low pass filtered the signal, then there is no risk in taking every other sample to complete the downsampling operation.  If you were to create a low pass filter that passed your spectrum of interest with no distortion, and rejected all energy in the alias frequency locations then taking every other sample would provide a perfect downsampling by a factor of 2 (there would be no distortion in you signal of interest). Of course, such a perfect filter is not feasible to implement but stated as such to show that the issue is not in taking every other sample but entirely in the filter design itself.


How to use Principal component Analysis(PCA) to extract feature from images

PCA is mostly used to reduce the dimensionality of the features.

You should first use a feature detector before you can use PCA to reduce the dimensions of these features. Common feature detectors are SIFT, SURF, ORB etc. Some of them are even available in OpenCV.


I think the best solution to your problem is to use the chirp-DFT. It's like a magnifying glass for a certain frequency range. It is more efficient than the direct implementation of the DFT (without FFT), because an FFT algorithm can be used with some appropriate pre- and post-processing. You basically need to modulate your signal with a chirp signal, then filter using an FFT, and then again chirp-modulate your signal to get the desired frequency response. See here and here for details on how to implement the chirp-DFT.


Python's $\tt resample$ vs $\tt resample\_poly$ vs $\tt decimate$

Downsampling and upsampling are operations that change the sampling rate of a signal. Each one of them is composed of two steps, changing the sampling rate and filtering. Usually, the amount of change is expressed as a ratio.

When downsampling, we are trying to take the signal from some $Fs$ to some $Fs_n < Fs$. The key problem with doing this is that we are effectively reducing the available bandwidth. Therefore, if we were to leave any frequency $f > \frac{Fs_n}{2}$ within the resampled signal, we would get aliasing.

Aliasing is a byproduct of sampling and it distorts the original signal. In DSP, we are trying to minimise it.

Therefore, when Downsampling, we first apply a low pass filter to the signal at its $Fs$ rate. This filter suppresses all frequencies that might cause aliasing. After applying the filter, we apply decimation. Decimation is a very simple process by which we are throwing away samples. For example, to downsample by $\frac{1}{2}$ you throw away every other sample (i.e. keep 0,2,4,6,8,...).

When upsampling, we are trying to take the signal from some $Fs$ to some $Fs_n > Fs$. The key problem now is not that we can't fit the amount of original data to the new bandwidth but the exact opposite. We now do not have enough data.

Sampling works by examining the value of a continuous signal at discrete times, specifically $Fs$ times per second. But, we don't really know what exactly does the original signal do in between those discrete instances we are examining its value.

Therefore, when upsampling, we first upsample, which is an operation that inserts silence in between the samples and then apply interpolation to make up the signal values during the silence bits. Interpolation is usually another low pass filter.

Obviously, we can use both of these operations to change the $Fs$ by any given ratio. But, no matter what this ratio is we first upsample and then downsample (with each upsample, downsample step composed of their own steps mentioned above). Otherwise, you are throwing away information.

So, having said this:

Decimate does downsampling.
Resample does upsampling / downsampling and the associated filtering, entirely in the frequency domain, using the Fourier Transform. Because it is using the Fourier Transform, a key assumption is that the signal that is fed in its input is periodic. In other words, if you supplied a recording of the word "Blue is a co", the Fourier Transform assumes that in reality, the signal sounds like "Blue is a coBlue is a coBlue is a coBlue is a coBlue is a coBlue is a coBlue is a co"...to infinity. This explains the Note towards the end of that page.
Resample_poly does upsampling / downsampling and the associated filtering, using a polyphase filter](https://en.wikipedia.org/wiki/Polyphase_quadrature_filter). (Notice the series of operations applied as mentioned in the documentation).

2 and 3 are essentially the same thing with different techniques for reasons of computation speed. In the techniques mentioned, filtering and decimation and upsampling and interpolation are performed in one step because they are inherent to the technique.

As you can see, changing the sampling rate involves throwing away information or "diluting" the information that was already captured in some signal $x$ during its acquisition at some $Fs$. This is why I asked you what are you going to do after the decimation because under certain conditions, your classification/ clustering might be affected if those tiny little characteristics of signals that differentiate them from each other are smoothed out.

By what you are mentioning, if your highest non-negligible frequency component is at 50Hz, this means that (theoretically), you can reduce your $Fs$ by $\frac{1}{3}$. In practice, try not to get too close to a lowest $Fs$ of 100Hz. Maybe leave some lee-way, say 120Hz.

Hope this helps.


What do colored noises look like in the time domain?

White noise implies no correlation between samples of the noise, even consecutive samples.  Colored noise, therefore, implies that there is correlation of some sort between the noise samples, which in turn implies that we can take advantage of that correlation to get rid of some of the noise.

Beyond that, there is not a lot that we can say about what it looks like in the time domain other than to say that colors that favor low frequencies, like pink noise, will tend to change more slowly, while high frequency colors, like "blue" noise, will tend to change more quickly.


Applying duality property to fourier transform of unit step function

The result you got is correct and it is also expected according to the two first formulas in your question. If $X(f)$ is the Fourier transform of $x(t)$, then the Fourier transform of $X(t)$ equals $x(-f)$. If $x(t)=u(t)$ is the unit step function then

$$X(f)=\frac12 \delta(f)+\frac{1}{j2\pi f}\tag{1}$$

and the Fourier transform of $X(t)$ is given by

$$\mathcal{F}\left\{\frac12 \delta(t)+\frac{1}{j2\pi t}\right\}=\frac12+\frac{1}{2 j}\mathcal{F}\left\{\frac{1}{\pi t}\right\}\tag{2}$$

where we recognize $1/\pi t$ as the impulse response of an ideal Hilbert transformer, the Fourier transform of which is given by

$$\mathcal{F}\left\{\frac{1}{\pi t}\right\}=-j\;\textrm{sgn}(f)\tag{3}$$

Combining $(2)$ and $(3)$ gives

$$\mathcal{F}\left\{X(t)\right\}=\frac12\big(1-\textrm{sgn}(f)\big)=u(-f)\tag{4}$$

just as expected.

Maybe you can clarify which books say otherwise.


Why does a wave continuously decreasing in frequency start increasing its frequency past the half of its length?

Make sure that your frequency doesn't reach values below 0 or above the half of your sample rate.

Please post more information/code about how you generate your waveform! Chances are you are not doing it correctly.

For example, if you want to generate a sine wave with a time-varying frequency $f(t)$ (for example to implement frequency modulation), generating something like:

$$y(t) = \sin (2 \pi t f(t))$$

is wrong, because your instantaneous frequency is:

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

And:

$$\frac{1}{2 \pi}\frac{d 2 \pi t f(t)}{dt} \neq f(t)$$

Except in the specific case where $f(t)$ is a constant.

The correct way to generate a sine wave with time-varying frequency $f(t)$ is thus with:

$$y(t) = \sin (2 \pi \int_{0}^{t} f(\tau) d\tau)$$

In synthesizer-speak the register/variable accumulating the instantaneous frequency to evaluate the $\int_{0}^{t} f(\tau) d\tau$ quantity is called a phase accumulator.

http://en.wikipedia.org/wiki/Frequency_modulation

http://en.wikipedia.org/wiki/Instantaneous_phase


Discrete State Space Model - Why Are We Calculating $ x \left[ k + 1 \right] $ Instead of $ \dot{\boldsymbol{x}} \left( t \right) $?

I will ask you something that will give you intuition.
How would you calculate the Gradient of an image?
Image is a discretization of reality, so how would you estimate the gradient of the "Reality" if you're given only the image?

In the case above we use Finite Differences to approximate the continuous derivative.
So what actually is approximating $ \dot{x} \left( t \right) $ is:

$$ \dot{x} \left( k \Delta t\right) \approx \frac{ x \left[ k + 1 \right] - x \left[ k \right]}{ \Delta t} $$

I do a little abuse of the $ k $ parameter yet I think you can understand what is going on there.


Tips for DSP self-study huh. Well, ...studying 'signals and systems' is a great idea and having Matlab software means you have the tools to learn an awful lot. I think Dr. Steven Smith's book "The Scientist and Engineer's Guide to Digital Signal Processing", which you can read online for free, is a terrific source of fundamental DSP information. Dr. Smith is a good writer. His book is at: http://www.dspguide.com/pdfbook.htm. Smith is a skilled working DSP engineer. That means he knows which end of the soldering iron is hot.

With regard to a free DSP textbook homework problems, I recently learned that Sophocles J. Orfanidis, the well-known professor with the ECE Department of Rutgers University, has made his signal processing textbook available for downloading on the Internet. The textbook is: "Introduction to Signal Processing" available at: http://eceweb1.rutgers.edu/~orfanidi/intro2sp/. Happily, also available at the above web site are:
(1) Errata for the Orfanidis textbook, (2) Orfanidis' Homework Solutions Manual, and (3) the errata for Orfanidis Solutions Manual.

At the risk of appearing tacky, you might consider my "Understanding Digital Signal Processing" textbook. It's been Amazon.com's top-selling DSP book for some years now. My book's been popular not because I'm any more DSP-skilled than other book authors---I can assure you that is not the case---but rather because I have some skill at explaining signal processing concepts from a working engineer's viewpoint rather than a university professor's strictly-mathematical viewpoint. My book costs money. However, I can assure you, I use the royalties from my book to buy milk and bread for my children.

So Anthony, learning the fundamentals of DSP through reading, performing lots and lots of Matlab modeling, and maintaining your enthusiasm, to quote Susan B. Anthony, "Failure is impossible." Good Luck.


In the U.S., a company called Nielsen has its watermarking technology encoded into broadcast content (Radio/TV/etc), while some 65k individuals called "panelists" wear a small pager-like meter called a portable people meter (PPM) which "listens" for and reports the watermarks that it "hears" (as the individuals go about their daily life). The "panelists" are essentially a statistically significant sample of the larger population of Radio/TV consumers.

  Nielsen’s watermarking involves codes, and each PPM transmits both
  complete and partial codes back to Nielsen. In situations where
  partial codes exist, Nielsen has edit rules that “fill in the blanks”
  by validating against nearby complete codes. Broadcasters are
  currently updating their station’s encoders with the Enhanced CBET (Critical Band Encoding Technology)
  technology. Prior testing and preliminary results from the roll-out
  show that there is an increase in the quality of the code detection
  and an increase in average quarter hour audience estimates.

Here are some links for you:

http://www.nielsen.com/us/en/press-room/2016/nielsen-to-increase-portable-people-meter-sample-size-by-10-percent-across-48-radio-metro-areas.html
http://sites.nielsen.com/newscenter/making-noise-nielsen-audio-gets-into-the-spirit-of-total-audience/


The good response by Laurent Duval provides a short overview of convolution and its properties and contains most of the information that you need. I think though that I see that you have some confusion about what is meant by filtering in general and how to apply a finite impulse response (FIR) filter in particular. I am attempting to explain some intuition behind FIR filtering here.

Something to keep in mind is that the length of an FIR filter should be shorter (preferably much shorter) than the signal that you wish to filter. This is because the result of a discrete convolution of two sequences is equal to the sum of the lengths of the sequences minus one, and part of this output is the transient response of the filter.

All filters have a transient response that applies to sudden changes in the input sequence (for example, a step function or discontinuity in the input). The beginning of a signal sequence looks like a step function to the filtering process (at least if you initialize your tap delay line with zeros as is typical). The end of the sequence has a similar transient response while zeros are being shifted in to replace the samples in the delay line.

The transient response occurs over the the first $N-1$ samples while the incoming signal is replacing the zeros in the delay line memory of the filter. This means that those first $N-1$ samples are not part of the steady state output of the filter. When we refer to the filtered signal, we are typically neglecting this transient response and are instead referring to the steady state output of the filter. This is often justified when the signal length is much greater than the filter length (the typical case), although not in your example where they are equal. If you use a filter of length $N$ and a signal of length $N$ as you have done, then the filtered output has length $2 N - 1$, and you have only $(2 N - 1) - 2 (N - 1) = 1$ sample that is not part of this (typically undesired) transient response. Most further processing will require more than $1$ sample to be effective, so this is probably not practical for you. In the typical case where the signal sequence length is much larger (say an order of magnitude or more), the steady state part of the output is also much longer than the transient part of the output.

Let's extend your example to illustrate this. If we were to apply your filter to a sequence of ones that contains $15$ samples instead of $5$, we would have an output sequence consisting of $15+5-1 = 19$ samples long. The first $4$ samples would be part of the transient and the last $4$ samples would be part of the transient (in fact, you can read this off of your $y$ output signal). If you were to drop these samples, you would see the steady state output which would be the value $3.72$ repeating $19-4-4 = 11$ times. Note that $3.72$ is the DC gain of your filter (the sum of the coefficients), so this is the expected outcome.

On the other hand, if we leave the first and last $N-1$ samples attached, then you would have
$$y=[0.5 \, 1.36\, 2.36\, 3.22\, 3.72\,
...\, 3.72\, ...\,
3.72\, 3.22\, 2.36\, 1.36\, 0.5]$$
where you can easily see the transient parts at the beginning and end of the filtered sequence.


Good way to detect pulse with known width with background noise?

For peak detection a nice method is the following: apply a maximal filter to the data and find the places where the filtered data equals to the original one.

A maximal filter is simply sliding through the data and selecting the maximal element from the sliding window. Formally:

$$g_w[x] = \max\left(f[x-w], f[x-w+1], \dots , f[x+w-1], f[x+w]\right)$$

where $f[x]$ is the original data, $w$ is the half of the window size and $g_w[x]$ is the filtered data. Selecting places where $g_w[x] = f[x]$ are either the local maxima of $f$ or plateaus of local maxima. Obviously we don't want to have plateaus, a single point per peak would be desirable.

The first trick we can do is to apply a minimal filter to the data, select the local minima, then choose places where we detected local maximum (based on the maximal filter) but not a local minimum. This will eliminate long plateaus.

The other thing we can do is to select 'up edges' so places where a non local maximum is followed by a maximum.

To make it clear I generated numeric data from the image you presented and wrote a short code. It uses two constants, one is the window size, the other is the minimum jump we require from a peak.

import numpy as np
from matplotlib import pyplot as plt
from skimage import feature
from scipy.ndimage.filters import maximum_filter

# put your data here
#data = np.array([0, 79, 75, 69, 69, 7, ...])

filter_win_size = 12
peak_intensity_threshold = 10

max_data = maximum_filter(data, filter_win_size)
min_data = -maximum_filter(-data, filter_win_size)

# select places where we detect maximum but not minimum -> we dont want long plateaus
peak_mask = np.logical_and(max_data == data, min_data != data)
# select peaks where we have enough elevation
peak_mask = np.logical_and(peak_mask, max_data - min_data > peak_intensity_threshold)
# a trick to convert True to 1, False to -1
peak_mask = peak_mask * 2 - 1
# select only the up edges to eliminate multiple maximas in a single peak
peak_mask = np.correlate(peak_mask, [-1, 1], mode='same') == 2

max_places = np.where(peak_mask)[0]

fig, ax = plt.subplots()
r = range(data.shape[0])
ax.plot(r, data, 'k')
ax.plot(max_places, data[max_places], 'xr')
ax.grid()
ax.axis((0, 409, 0, 130))
plt.show()


Generating inaudible sound waves using MATLAB

Eventhough the exact cause of those wide-spread line spectra is not very clear to me from the supplied information, it's most probably due to the on-off switching implied by the silence period you have added in between your message signals.

The on-off waveform is an implicit operation you multiply to your signal. Which has a value of $1$ during the sound interval and a value of $0$ during the silence interval. The fundamental period of that waveform is roughly 200 Hertz.

More technically, the on-off switching with a given duty-cycle will shift the message spectrum by the amount of k-th harmonic frequency for each significant harmonic present in the continuous Fourier series of the on-off waveform.

In fact this is a method of realizing an analog modulation algorithm. Multiplication with a rectengular wave creates a multitude of harmonic centered up-mixed spectrums, of which only one is selected by a suitable bandpass filter.

Therefore as a solution offer, you could try the following:

1- Generate the 18kHz (already bandpass) message signal in time domain.

2- Insert the silence periods accordingly.

3- Apply a BPF (bandpass filter) centered around 18Khz.

When implemented carefully this should yield a solution to your problem I guess. Distortions in the message signal can happen however.


There is no unique definition, but in general baseband signals have a spectrum that starts close to DC. Most analog information sources that are considered in communications are baseband: audio, video, signals from sensors, images, etc. Also, any signal that is a sum of pulses of different shapes is a baseband signal; examples are NRZ and Manchester-encoded signals. Yet another definition is that a baseband signal has not been modulated, or its spectrum has not been shifted, for the purpose of matching it to a particular communication channel.

Passband signals were originally baseband, but were modulated, or frequency-shifted (or up-converted) for some purpose, usually to make them fit in a passband channel. Consider the case of AM radio. An audio signal is low-pass filtered to 10 kHz, resulting in a baseband signal with a spectrum from 0 Hz (or strictly, 20 Hz) to 10 kHz. Then, this signal is shifted up in frequency (upconverted) to make it fit into the 20 kHz channel assigned to the AM station. The receiver down-converts the signal back to baseband and plays it over the loudspeakers.

As you say, the upconversion process involves changing the amplitude, frequency and/or phase of a high-frequency carrier signal proportionally to the information-bearing baseband signal. The receiver uses the amplitude, frequency and/or phase of the carrier to reconstruct the baseband signal.


How can I enforce aliasing with Audacity?

Here's a Python script that does what Matt L said:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Enforce aliasing by reducing an audio-file to every n'th frame."""

from scipy.io.wavfile import read, write

def main(inputFilename, outputFilename, n):
    rate, data = read(inputFilename)
    write(outputFilename, rate/n, data[::n])

if __name__ == "__main__":
    from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
    parser = ArgumentParser(description=__doc__,
                            formatter_class=ArgumentDefaultsHelpFormatter)
    parser.add_argument("-i", "--input", dest="inputfile",
                        help="input WAV file", metavar="FILE")
    parser.add_argument("-o", "--output", dest="outputfile",
                        help="output WAV file", metavar="FILE")
    parser.add_argument("-n",
                        dest="n", default=2, type=int,
                        help="every n'th frame gets played")
    args = parser.parse_args()
    main(args.inputfile, args.outputfile, args.n)

It might not be audible at factor = 2.  Try other powers of 2.


Time domain interpolation using FFT with zero padding on the end

It's important to remember that, for an even N, you have both F(0) and F(N/2) points, neither of which has a counterpart.  So, for instance, with N = 8, you have:

F(0),  F(1),  F(2),  F(3),  F(4),  F(-3),  F(-2),  F(-1)

(some people consider the N/2 point as a negative frequency ( ie: F(-4) ), but we'll consider it to be positive)

So to interpolate an 8 point FFT by a factor of 2, you'd do a 16 point inverse FFT using:

F(0),  F(1),  F(2),  F(3),  F(4)/2,  0,  0,  0,  0,  0,  0,  0,  F(4)/2,  F(-3),  F(-2),  F(-1)

So you split the N/2 point of your forward FFT, and add the appropriate number of zeroes in the center, and do the inverse.

Now, for an odd number N, you DON'T have an N/2 point (but you still have a unique 0 point), and the splitting business doesn't happen (but you still have to add the appropriate zeroes in the center).

I suggest you experiment with the FFT/IFFT method by using: a real input time domain waveform; a complex input time domain waveform; even and odd N; an integer number of cycles in the input; a non-integer number of cycles in the input.  Then compare/contrast your results from the FFT/IFFT method with to those generated by a strictly time domain based interpolation (eg: use A*cos(omega*t) for the FFT/IFFT method and compare to A*cos(omega*t/2) generated in the time domain).  Experience can be enlightening.

As for your multiplying method – I don't think it will work for an even N.  And the FFT/IFFT timing, unless you're using very small FFT's, will probably dominate the total run time (of, course, you should always profile your programs to make sure).


Impulse response of the system image processing

You imagine several representations. A first one is the standard image representation: flat in the $(x_1,x_2)$ and a color scale  of the intensity value (left plot). A second one is a 3D vision as a topographical or elevation map, with homogeneous color (middle plot). The visualization might be a bit more complicated. A third one combine the two preceding aspects (right plot). The latter helps understanding some mathematical morphology operators (like the watershed).

L = membrane(1,100);
f = figure;
ax = axes;
subplot(1,3,1)
imagesc(L);
subplot(1,3,3)
s = surface(L);
s.EdgeColor = 'none';
view(3);axis tight
subplot(1,3,2)
s = surface(L);
s.EdgeColor = 'none';
s.FaceColor = 'b';
view(3);axis tight


Either of your suggested approaches would work (adapting modulation/coding scheme on a per-subcarrier basis or changing all subcarriers at once). There's no theoretical constraint that prevents you from doing that; it's simply a question of whether the added efficiency of tuning individual subcarriers is worth the increased system complexity.


Why root raised cosine filter can eliminate intersymbol interference (ISI) ?

In addition to the frequency response that AlexTP showed, I think the time domain view of the impulse response gives good insight into the Zero-ISI operation of a Nyquist filter. Below is shown the result of transmitting three symbols, than each began as a single impulse. Each plot below is the "impulse response" for each symbol. Note the blue symbol was transmitted first and is maximum at time index 0 on the graph (but began much earlier than this in time). This position where the impulse response is maximum is our ideal sampling location to determine what was transmitted. One sample after the original impulse for the blue symbol, came an impulse for the red symbol. Notice at the ideal sampling location for red (where it is maximum), the response from all the other symbols is zero (meaning zero ISI).

The pulses shown above have zero ISI at the sampling locations, but extend to infinity to achieve the maximimum conservation of bandwidth (1/(2T)). Of course, this is not feasible, so the raised cosine pulse shape applies a window to truncate the perfect Sinc function, resulting in a trade of bandwidth versus filter complexity, as well as trades with other characteristics related to performance for timing recovery.

The filter is often split between transmitter and receiver as a "root-raised cosine filter" (RRC) on each side. Note that a RRC filter does NOT have zero-ISI until it is paired with the second RRC filter to form in cascade a raised cosine filter.
Below is an example eye diagram, showing the trajectory over 1 symbol for multiple pulses (each trajectory is based on the history of all previous symbols within the depth of the RRC filter and results in a different path when going from 0 to 1 or 0 to 0 etc).  At time 0 is the ideal sampling instant to decide between 0 and 1, notice with the RRC filter that there is significant ISI, which is eliminated after passing through the second RRC filter in the receiver (assuming no other multipath effects have occurred).  Also notice for the filter with alpha = 0.25 that there is a significant spread in the zero crossing locations, which would add more noise in timing recovery operations that are sensitive to zero crossings. Compare this to the eye diagram with alpha= 1 and notice the significant decrease in zero-crossing jitter, as well as a wider "eye-opening" which also means less sensitivity to jitter or other errors in the sampling clock location, but this benefit comes at the expense of less spectral efficiency.

What is very interesting is this alternate pulse shaping Nyquist filter in this paper http://eon.sdsu.edu/~seshagir/SDR05.pdf that fred harris now refers to as the "harris-Moerder Nyquist Pulse". Using this as the pulse shaping filter results in an order of magnitude lower EVM for the same number of taps. This isn't commonly used even today (15 years later) to my knowledge since the root-raised cosine filter is baked into our specifications but certainly is very compelling to be aware of for consideration in future radios.


Is noise figure dependent on input noise power?

To answer your question, Noise Figure is the amount of noise that would be added referenced to the input of the amplifier assuming no prior noise amplification has been provided in a properly matched system. This equates to a change in the SNR of the output relative to the SNR of the input, and the input noise level with no other gain would be typically referred to as the "thermal noise floor".

So given that, and to your example, if the gain of the amplifier was 1 (0 dB) and the noise figure was 5.5 dB, then in this case the signal out would be equal to the signal in (gain = 1) but the noise out would be 5.5 dB higher than the signal in. (and hence if you follow SNR out vs SNR in you see that this would hold).

To further demonstrate, consider if the amplifier had a gain of 10 dB with the same 5.5 dB Noise Figure. Here the signal out would be 10 dB higher than the signal in, but the noise out would be 15.5 dB higher than the noise in.

Now to further demonstrate noise figure, consider the same case with adding a noise free 10 dB gain amplifier in front of our noisy 5.5 dB NF amplifier: At the input to the noisy amp the signal will be 10 dB higher and the noise will be 10 dB higher relative to the thermal noise floor. Our noisy amp adds +5.5 dB of noise relative to the thermal noise floor, so referenced to the noisy amp input according to this noise figure model, in this case, the total noise will be:

$10Log(10^{10/10}+10^{5.5/10}) = 11.32$ dB above the thermal noise floor.

While the signal will be 10 dB above the input signal level at this point.

(Note this isn't the actual level that would be measured at the input of course but is the "input referenced" noise as measured at the output of the amplifier--as the noise is added in the amplification process).

At the output of our noisy amp, due to its +10 dB gain, the signal will be an additional 10 dB higher, as well as the noise, resulting in a final noise output level that is 21.32 dB above the thermal noise floor. The total change in signal level was +20 dB, while the total change in noise level was +21.32 dB. The change is SNR was therefore only 1.32 dB. This is the Cascaded Noise Figure showing how a prior lower noise amplifier can reduce the overall noise figure of the system.  The actual formula for this is given below, but following the details above helps give the background of how this works. The bottom line is that the noise figure is the additional noise that is added referred to the input of the device relative to the thermal noise floor. Increasing signal and noise prior can swamp out this additional added noise later.

$F_T = F_1 + \frac{F_2-1}{G_1} + \frac{F_3-1}{G_1G_2} ...$

Where

$NF = 10Log_{10}(F)$

and gain in dB = $10Log_{10}(G)$


elementary one and multidimensional real examples of continuous/discrete LTI systems

If you care for multidimensional signals, let us use "shift-invariant" maps. To analyze such systems, Fourier transforms are tools (for engineers) of choice. I often say that Fourier transforms are to convolutions what logarithms are to multiplications: a tool that helps explaining what is less than obvious (diagonalization of the convolution operators), and that can become computationally efficient (FFT), and sometimes a game changer: mp3 and JPEG formats boosted the use of Internet.
Meanwhile, invariance is a very useful concept, and Fourier is a central operator in mathematics, and still subject to many research and open questions (for instance on series convergence). I had the opportunity to hire a skilled mathematics student (Jérôme Gauthier) for a PhD in signal processing on the synthesis in oversampled complex filter banks. I remember that during the overview, as a mere DSP engineer, I asked him about his knowledge on the Fourier transform, and he was (then) pretty confident. Later, he discovered another side of it (by the way, I rediscovered the least-squares parabolic extrapolation recently, which I though I mastered, from the computer science and real-time computing point of view).
So, the interplay between engineers and mathematicians is quite important, because one can shed a different light on how the other deals with it. For instance, research on the mathematics behind invariance is helpful to design novel algorithms. For instance, finding invariant transformations of graphs is of current interest.


Problem you are aiming at is connected with Phonocardiography (recording bodily sounds). Traditionally contact sensors (such as stethoscopes) were used for this task, but problem is that you must raise and lower the device between two measurements. In case of air-coupled microphone (meaning that it is not touching the body) you can move it constantly, performing a continuous measurement.

Obviously there is some disadvantage, such that it is prone to environmental noise, but shielding (tubes) are used, as well as microphone arrays for noise cancellation. Problem of coupling the membrane with patient body is very hard to tackle, as big mismatch exists between air characteristic impedance and body impedance, but using a conical shape is helping to transform these impedances.

What kind of microphones were being used? These are almost the same used widely in recordings:

Condenser
Electret
Piezoelectric

Some of these were adapted for recording of infra-sounds, i.e. Brüel & Kjaer, model 4117 or other great, 4135. Although people are also using quite cheap electret microphones for this task.

This article can shed some light on that:

  Algernon D., et al. - Signal Processing for Air-Coupled Impact-Echo
  using Microphone
  Arrays.


Neither.

A true compression ratio is: "original file size in bits" divided by  "compressed file size in bits". A practical (based on disk limits) compression may embed the chunk size effect: "original file size in number of chunks" divided by  "compressed file size in chunks", less favorable.

Some of the main reasons for "neither" are:

DCT is not the only method for image compression: dct co-efficientswould be meaningless for non-DCT methods
in JPEG, DC coefficients are further predicted in a raster fashion
images have color components, further decorrelated and differentially quantized to reduce variability
even assuming that DCT can stand for "transformed into less redundant symbols": you are loosing the header, the entropy or dictionary coding, and never complete the construction of an actual string of compressed bits.
the "amount" of DCT coefficients, or "dct co-efficients" is not precise enough to be counted.

However, an estimate of the number of bits taken  by quantized DCT coefficients (through entropy for instance), when divided from the original image size, can provide a rough estimate of what you can expect from JPEG compressing, at least at intermediate bit-rates.


How to mix two signals without changing the overall loudness?

That depends somewhat on the application. In most cases a "constant energy" pan will be best. This can be expressed as $$y(t)=\sqrt{\alpha} \cdot x_{1}(t)+\sqrt{1-\alpha}\cdot x_{2}(t)$$ where $\alpha = .5$ is the point of equal energy.

If you are working with fixed point signals, such as wave files for examples, you may run into clipping problems. That could be a topic for a separate question.


Daubechies Wavelets in mulitresolutional analysis decomposition

As I mentioned in my comment, the reason seems to be the so-called "wavelet crime" which is taking the sampling data as the inner product. But I found a question, which is similar to mine

Wavelet transform: How to compute the initial coefficients when only samples are available?*

This question was answered with a lot of papers, many thanks to Laurent Duval. In one of the paper

On the Initialization of the Discrete
Wavelet Transform Algorithm

there is a derivation to calculate the initial inner products. One can approximate the inner products as
$$
c_k = \int_\mathbb{R} f(t)\varphi(t-k)dt \approx \varphi(-k)
$$
And one can read the following remark:

"A very good approximation of the time-shape of $\varphi(t)$ can
be obtained as the impulse response of the filter h convolved
with itself a large number of times. One then simply needs
to collect the samples ${\varphi(p) = \varphi(t = p)}_{p\in\mathbb{Z}}$ to perform the
approximate initialization"

Therefore it is sufficient to know the filter coefficients as given in Wikipedia.


Filter wrap-around to avoid dealing with settling time? Using a Butterworth

If your input waveform is periodic, then wrap-around is appropriate. The most straightforward way to do this is: Initialize the filter state to correspond to an all-zeros input history. Start filtering from the beginning of the input data, writing the output to an output buffer (or in-place to the same buffer, but then the filter has to store its state internally). When the time index runs out of the data buffer, wrap it back to the beginning and keep inputting the filter with zeros for some time while adding the filter's output to successive samples of the output buffer.

You can continue this until the absolute values of the filter's state variables all go under some small threshold value decided by you. This gives an upper limit to residual error in the output. The state of a typical infinite impulse response (IIR) filter is equivalent to (or is directly) its n most recent output values, with n depending on the filter's order. You can keep count of how many of the most recent absolute output values were below the threshold, and when the count reaches n you are done. Or simply decide beforehand how long you will continue, as, for a particular filter, that will determine an upper limit to the residual error proportional to the input.

Note: the period of the input waveform should be an integer multiple of the sampling period.


There are no phase jumps. The discontinuities in the phase plot result from the computation of the principal value of the phase, which requires the phase to be in the range $[-\pi,\pi)$. But this is just a convention and has nothing to do with the physical system. Apart from issues with the principal value, the phase of allpass systems does not jump. Instead, the phase always decreases monotonically, because the group delay of an allpass is non-negative (Eq. (5.98) in Oppenheim's book). Also, if you look closely, the first "jump" is actually not at $\omega=\pi/4$ but a bit before, so it is not at all related to the pole angle.

'Real' phase jumps occur with systems whose frequency response has zeros. At these frequencies the phase jumps by a value of $\pi$. But obviously this can't happen with allpass systems because their frequency response is constant and doesn't have zeros. (Don't get confused: an allpass transfer function does have zeros in the complex $z$-plane, but not on the unit circle; this is why its frequency response, i.e. its transfer function evaluated on the unit circle, has no zeros).


Design of 10th order high pass filter using 2nd order biquads with Matlab and further substitution on to TI AIC3204

Your basic approach seems correct so far.
To implement your 2nd order filters you have to cascade the biquad filters, so that the output of the first feeds into the input of the next and so on.

This is due to the theorem that the overall transfer function $H(z)$ of $n$ cascaded subsystems is the multiplication of the transfer functions of the respective subsystems $H_i(z)$ like this

$$ H(z) = H_1(z) \cdot H_2(z) \cdot \,\, ... \, \cdot H_n(z)$$

So what Matlab gives you, are the coefficients $a_j$ and $b_j$ for the biquad filter transfer functions (called SOS matrix in your result):
$$ H_{biquad}(z) = \frac{b_0 + b_1z^{-1} + b_2 z^{-2}}{1 + a_1z^{-1} + a_2 z^{-2}}$$

To implement it you should use the Direct Form I in time domain - its just the inverse Z-transform of the transfer function above:

$$y[n] = b_0 x[n] + b_1 x[n-1] + b_2x[n-2] - a_1y[n-1]-a_2y[n-2]$$

Now you just have to cascade the filters, so that the output $y[n]$ of the first feeds into the input $x[n]$ of the next biquad and so on.

You may also want to check a similar question asked here: How does cascading biquad sections for higher order filters work?

And also the documentation of the Matlab biquad filter where it tells you how the SOSMatrix and ScaleValues are defined:
Matlab Biquad Documentation


Split audio signal into frames, apply window function and merge again

Von Hann (but not Hamming) windows with a 50% overlap sum to unity (except possibly at the very start or end of a file).  If you do any processing, rather than just analysis, in the frequency domain, you may find overlap add or overlap save with a rectangular window to be more appropriate.


What is the most computationally efficient way to generate 100 sine waves layered on top of each other?

The most computationally efficient approach is to set up the data you want in the frequency domain by putting in the tones as "spikes" in the appropriate frequency bins, and then inverse FFT'ing it to get the time domain tones.  This approach will likely be a couple of orders of magnitude or so faster than your approach.

There are some downsides to doing it this way.  For tones whose frequencies are integer multiple of the sample frequency divided by the number of samples it is easy- just put a spike in at the appropriate frequency bin.  For all other frequencies, though, you need to put some energy into the neighboring bins as well.  I would have to think about how exactly to figure out how to do this.  I'm sure it can be done, but it's not a no-brainer.

Also, if you need to just produce a block of samples with the tones this approach is ideal.  If you need to create a continuous stream, though, care would have to be taken to get the phases right from block to block.  Again, not a no-brainer.

All that being said, I am pretty sure that this is the most computationally efficient approach.


Remove audible click sound from high frequency hopped sound

One method is to adjust the phase of the sinusoid at the beginning of each segment to minimized the 1st or 2nd delta phase difference from the phase at the end of the last segment.  Another method might adjust several samples at each boundary to minimize multiple derivatives.

You currently seem to start with a phase of zero, which could randomize the phase delta between segments, depending on frequency and segment length.


Yes, when we can recover OFDM in fading scenarios along with gaussian noise, then yes we can also recover it in just gaussian noise. You can think of fading coefficients having a magnitude of 1 and phase zero


is there a second order approximation to perceived loudness

This depends highly on the signal and it's content. For narrow band signal, the loudness can fairly well be estimated through the equal loudness curves as published in ISO 226 (see for example) http://en.wikipedia.org/wiki/Equal-loudness_contour

For wide band signal, things are more complicated. If the signals are stationary, you apply frequency weighting curves for the appropriate overall loudness (such as "A" or "C" weighting), which gives in some cases a reasonable estimate but can also be quite off by  a fair amount.

Next step up in complexity would be a loudness calculation based on on a detailed perceptual model. So you split the signal into "critical bands", apply forward, backward, simultaneously masking thresholds, apply frequency weightings and than integrate this all up. The resulting loudness is often measure in "Sone" which intended to be a "ratio scale", meaning it has an absolute zero value (threshold of audibility) and 6 Sones is twice as loud as 3 Sone.

So overall it's possible to get very accurate estimates of perceived loudness even for non stationary signals, but it requires deploying very complicated perceptual models. These models basically the same ones as used in perceptual codecs such as MP3, AAC, Dolby Digital etc.


You're right, a single (real-valued) zero in the RHP could cause a phase that moves from $\pi$ at $\omega=0$ to $\pi/2$ for $\omega\to\infty$. However, if you rewrite the corresponding contribution to the transfer function as $s_0-s$ (i.e., you change the sign), then you obtain a phase shift between $0$ at $\omega=0$ and $-\pi/2$ for $\omega\to\infty$.
The difference is just a sign inversion, i.e., an addition of $\pm\pi$ to the phase. The contribution of a single real-valued RHP zero in the form $s_0-s$ does not invert the sign for $s=0$, whereas if you write it as $s-s_0$ you get a sign inversion, hence the additional phase shift of $\pi$.


Dominant Frequency Peak Decreases with Increasing Window Size

Since your signal isn't sampled uniformly some strange things might happen when you apply FFT and look at the results.

What you should do is estimate the Uniform DFT of the Non Uniform Time Series.

One easy way to do it is use the reference code and analysis I posted on the question - Frequency Analysis of a Signal Without a Constant Sampling Frequency (Non Uniform Sampling in Time Domain).

Apply it on your data and things should behave more consistently.

One more thing, if you're after a peak, something which will make easier analyzing the data will be centering it. Namely make sure the samples have zero mean.


How to sample $f:=f_{1}\cdot f_{2}\cdot...\cdot f_{K}$?

The definition of bandlimited is that $\hat f_k$ has compact support of size $\sigma_k$. To make our argument easier, we'll also note that we can decompose every $\hat f_k$ into $\tilde f_k * \delta_k$ (a convolution with a dirac impulse, just a shift) so that $\tilde f_k$ is "0-aligned", ie. $\sup f_k = \sigma_k$ and $\inf f_k=0$.

For $f_1\cdot f_2$ follows directly that the support of $\tilde f_1*\tilde f_2$ has the property

$$\text{supp}(f_1*f_2) \subset [-\sigma_2;\sigma_1]$$

from the way we calculate the convolution:

$$(f_1*f_2)(x)= \int\limits_{-\infty}^\infty f_1(y)f_2(x-y)\,dy$$

Now, that support has "length" (to be more exact, an upper boundary for measure) $\sigma_1+\sigma_2$.

It's very intuitive to now apply induction to show that this applies to all $k$.

So, in the end, $\text{supp}\left({\Large*}\left(\tilde f_k\right)_{k=1}^{K}\right)\subset [0, \sum\limits_{k=1}^K \sigma_k]$.

Since the shifting around in frequency domain doesn't theoretically (measure of $\delta_k0\,\forall k$) nor practically matter (compare: undersampling), we can just sample sufficiently by observing the sum bandwidth.

Note that this has very practical effects, for example, when sampling signals that are reflected by moving targets.


Orders of complimentary butterworth filters for IMU

You are simply seeing the quantization of the double type. Basically you have a pole and a zero that should cancel each other out. But because of the limited precision of the double data type, it doesn't. So instead of having 0 dB you have a gain of 10^-15 dB give or take.

But in real life,  99.99999% of the time 10^-15 dB = 0 dB

For the record, I think you could use the minreal function in Matlab to cancel the almost equal pole(s) and zero(s). You would then get your unity gain and your flat bode plot with 0 dB and 0 degree phase.

I don't like simply posting links, but a reminder on how floating-point works should help you.

https://en.wikipedia.org/wiki/Floating-point_arithmetic


This is mostly a matter of history.

Checkerboard patterns have proven in the past to:

yield calibration accurate results
be easy and robust to implement.

This was confirmed (for example) by a benchmark performed by NASA long time ago, where they were assessing visual solutions to control robotic arms.

Why are checkerboards robust and accurate? Because they provide features that can ve computed as intersection of lines.
Linear features were easy to detect accurately (using Canny-Deriche, SUSAN, Hough transform...), while most point detectors were computed with pixel accuracy.
Furthermore, checkerboards do provide line intersections, which are:

robust: if a part of the calibration pattern is occluded, you can still get the coordinates of the intersection points thanks to the line equation
accurate: line equations can be interpolated from sample points, and this is the case for their intersection too. Thus, you naturally get subpixel precision. This holds also for the old-fashioned pipelines where the corners were actually clicked by somebody

By robust to occlusion, I mean that you just have to continue the parts of the lines that are visible to get the intersection coordinates.
With dots this is more hazardous, because you have less clues to infer the overall line direction. Also, when some dots are occluded, it's very difficult to know which ones are indeed occluded. Instead, using checkerboards of known size (e.g. $8 \times 8$ squares), then you can infer which tile exactly is hidden as long as you see the borders of the checkerboard.

A possible advantage of checkerboard patterns is that since you have line featurs, then it may be easier to infer distortion coefficient values, which is harder to do if you need to "connect the dots" of aligned points.

Modern point detectors (starting from Harris corners) perform interpolation to reach subpixel accuracy in point detection, and since checkerboards provide a lot of corners they continued to be used, just switching from line primitives to corner primitives.


How should this fft output be intepreted?

"[...] the real part is the amplitude, and the complex part is the phase [...]" No, complex numbers (and that's what the output of a DFT/FFT is) can be represented either by their real and imaginary parts (as in the output vector of your routine), or by their magnitudes and phases. Please refer to the linked page on how to convert one representation to the other.

The indices $i=0,1,\ldots N-1$ of the output vector of a length $N$ DFT/FFT are related to actual frequencies via the sampling frequency $f_s$:

$$f_i=\frac{if_s}{N}$$

If the input vector is real-valued, the first $N/2+1$ values (assuming $N$ is even) contain all information about the signal.


In the case of 2 images $m_{1}(x,y)$ and $m_{2}(x,y)$ of size $m×n$ , where $(x,y)$ are the coordinates of the image, the correlation constructs a matrix $A$ where each $A(i,j)$ is the degree of similarity between the image $m_{1}(x,y)$ and $m_{2}(x+i,y+j)$ (note that $m_{2}(x+i,y+i)$ is the image $m_{2}(x,y)$ translated $i$, $j$ pixels). This degree of similarity is basically a measure of the angle between the vectors $v_{1}$ and $v_{2}$ of $R^{m×n}$ that could be constructed by vectoring the images $m_{1}(x,y)$ and $m_{2}(x+i,y+j)$, this is because for each $i, j$ What the correlation really does is the normalized dot product $\frac{v_{1}.v_{2}}{|v_{1}||v_{2}|}$. Remember that $v_{1}.v_{2}=|v_{1}||v_{2}|cos(θ)$, where θ is the angle between the vectors $v_{1}$ and $v_{2}$.

In conclusion, the maximum $A(i,j)$ tells you that for the degree of similarity (angle θ) between $m_{1}(x,y)$ and $m_{2}(x,y)$ to be maximized, $m_{2}(x,y)$ must be translated $(i, j)$ pixels.

This measure of similarity is not very good, since it is not robust to changes in tones, lighting, noise, among others. There are other comparison alternatives such as PCA, SRC, SIFT or SURF.


How do I check for linearity for the following piecewise-defined system?

First, you are not trying to find the linearity of a signal, but the linearity of a system defined by the transform above between input and output signals.
If you suspect your system is not linear (the different expressions depending on the sign of $x(t)$ is a big red flag), then you only need a counterexample rather than a general proof of linearity.
In this case, if you scale your input by a negative number, the output is not scaled accordingly. That is: $T{\alpha x} \neq \alpha T{x}$ if $\alpha$ is negative.


Sure. The idea behind CDMA is that different users codes are orthogonal.

So, since your codes probably are pretty white, meaning that their autocorrelation function is essentially a dirac delta, you can simply encode an pulse for every user (or by every user), and use the standard correlation receiver to despread and thus recover each individual channel impulse response.


Signal sparsity: with noise or without noise?

Actually, the beauty of compressive-sensing lies in fact that it works for signals which are approximately sparse. Recovery algorithms in CS are based on L1 norm minimization and have moderately tolerate noise in measurements. However noise surely reduces probability of exact recovery and degrades quality of recovered signal. If there is noise in a sparse signal you might need to take more measurements for exact recovery.
Take a look at this for further information:
http://statweb.stanford.edu/~candes/papers/spm-robustcs-v05.pdf


If a Kalman filter can only receive information on $(x, y)$ position, is there any reason to have acceleration as part of the model?

Whether to include a particular parameter in the model depends on how much you know about the parameter. If you're already including 2D velocity in the state, then the acceleration will be coming in through the random noise assumptions you are making.

Whether tracking a person will improve if you include the 2D acceleration in the state depends on what assumptions you can make about how the person's acceleration changes.

For some models, we might know that the jerk$^1$ is completely random but not the acceleration. In that case, it would make sense to include the acceleration and feed the randomness in as the jerk (change to the acceleration).

${\tiny^1\sf \mbox{The derivative of acceleration, I'm not casting aspersions. }}$


Calculating the fundamental frequency using Autocorrelation often gives half the expected value

...analyse musical notes and find the fundamental frequency to determine the pitch.

So, measure 440 Hz and output "A" (?), a tuner application.

  To do this I'm reading in audio data, taking an FFT, taking the auto-correlation of that FFT and then finding the IFFT of that.
  Having done that I then find the maximum peak (which seems to always be a zero) and then find the next highest peak and determine the lag between them. Finally I calculate the period from this and find the fundamental frequency.

This sounds like the superposition of two methods and two domains.

In the above process, once you obtain the FFT, you "transit" from the time domain to the frequency domain. In this domain, your signal is expressed as a sum of sinusoids at different frequencies.

Therefore, all you have to do (in this frequency domain) is locate the highest peak sinusoid.

This might be very easy if you are recording an electric instrument (bass, guitar, other) over wire or very challenging, if you are recording an instrument over the standard microphone found on a mobile phone.

BUT!, instead of using the FFT first, you could obtain the autocorrelation of the signal and then examine if that autocorrelation is periodic. The added benefit of this is robustness to noise.

Assuming that a dominant sinusoid exists in a recording, measuring the distance between the first and second peaks of the recording's autocorrelation would give an estimate of the period of the sinusoid. This technique applies to the time domain.

Because of the noise aspect, you might have to use a combination of the two. So, for example, record a signal, take its autocorrelation then apply FFT to the autocorrelation to discover its periodicity. In parallel to this, you might want to estimate spectral flatness as a measure of quality because it might be that the signal at the input does not contain any periodic component.

Finally, please note that due to the way discrete autocorrelation works, the autocorrelation of some signal $x(n)$ composed of $N$ samples, will have a length of $2 \times N - 1$ samples...which would need to be taken into account when trying to derive timings and frequencies from it.

Now, this is as far as what is mentioned in the question is concerned. In general, there are various techniques to perform pitch detection ranging from the very simple to rather complex ones. For a brief overview, please see this link, this link and this link, while, for something more specific, please see this link and this link

Hope this helps.


Calculating bpm from machine sound (not music)

There are two differences between your problem and music beat detection:

The beat in music is a "latent" grid. It's not because a track is at 120BPM that you have exactly 2 notes per second. In music, the beat is more of a lowest common periodicity than an exact pulse train - that's why beat trackers often make octave errors, and also why there is no consensus between human listeners as to what is the BPM of some tracks. Your task doesn't suffer from the same ambiguity because every "hit" counts.
The beat in music rarely changes over time; and when it changes, it is often progressive. As a result, the tempo can be assumed constant over windows of 5 or 6s for music. Judging from the video, you cannot make this assumption; because the "rhythm" here is very irregular; with pauses/breaks, and frequent changes.

Because of these, I fear that all the assumptions embedded into beat tracking algorithms made them useless on your problem. My suggestion would be to just use an onset detector with a high threshold (to make it more robust to noise). The events you want to detect seem to cover a rather wide frequency band anyway and have a fast decaying envelope.

Then, simply measure the time delta between adjacent events (when this delta is too high; consider that this is a pause); and eventually, average this over groups of a couple events.


How can i record 1 MHz signal and do a real-time processing in a PC?

Stanley is right and what you need is a data acquisition board. Depending on your application concern, you can either buy it from an online store or build your own if you can do so.

If you would like to make it on your own, then as MBaz suggested you can select from mini pc boards such as a sufficient Raspperry pi that can either transmit your grasped data to your PC at ethernet 100T speeds or the Pi itself can also be used to do the whole analysis as MBaz indicated.

Unfortunately, here you cannot find help on the hardware design of such a board....


Make a Movie from Multiple Images in MATLAB

It is easy to do using the VideoWriter class.

You easily add frame (Image) using the proper method which is writeVideo.

After creating a video object, videoObject and given an image by mImage001, adding frame is done by:

writeVideo(videoObject, mImage001);

Enjoy...

Code Sample

Here is a code sample based on Mathworks documentation with some remarks of mine:

% Creating Video Writer Object
writerObj = VideoWriter('peaks.avi');
% Using the 'Open` method to open the file
open(writerObj);

% Creating a figure.
% Each frame will be a figure data
Z = peaks; surf(Z);
axis tight
set(gca,'nextplot','replacechildren');
set(gcf,'Renderer','zbuffer');

for k = 1:20
   surf(sin(2*pi*k/20)*Z,Z)
   % Frame includes image data
   frame = getframe;
   % Adding the frame to the video object using the 'writeVideo' method
   writeVideo(writerObj,frame);
end

% Closing the file and the object using the 'Close' method
close(writerObj);

This should be straight forward.


simulating multipath via tap delays in FPGA

Perfect destructive interference is possible in theory, but very difficult to do in practice without feedback to dynamically adjust.  The reason for this is that there are three things you have to get just right to eliminate the tone: frequency, time (or equivalently, phase), and amplitude.  If you get any of those wrong there will still be a tone (or rather, two tones) left over.

Frequency  No matter what you do at the baseband level (i.e. in the FPGA), the frequency will not match if your upmixing does not exactly match your downmixing.

Time/Phase  This is a lot more complicated than you realize.  First, your phase-per-tap calculation requires that the sinusoid be exactly 2.462GHz and that your FPGA frequency be exactly 200MHz.  Neither one is.  You can never get an exact frequency, there is always some error and jitter.  If you take the derivative of the phase-per-tap with respect to the sinusoid frequency (2.462GHz), you will find that the phase per tap is very sensitive to sinusoid frequency errors.

You have also not taken into consideration the time delays through your ADC, DAC, and connectors, passive analog components, etc.  They all matter too.  Long story short, I would not try to figure out the correct delay, I would empirically see how the jammer's phase relates to the original sinusoid and adjust from there.  Yes, you will almost certainly have to use fractional delays.

Amplitude  Even if you get the frequency and phase right you will only be changing the tone's magnitude unless you match its amplitude.

I hope that see that you have taken on a very difficult task.  Since you are only trying to test simulated delays, I would find an easier way to do that.  I would look at using chirp signals, and then vary the delays to move the responding chirp in time.


Is Mask R-CNN a good fit for what I want to do?

I'm looking at isolating the foreground from a set of photos

This is called semantic segmentation. Instance segmentation is where the network actually can tell the difference between different instances of the same type. For example, a few apples on a table will be instance segmented and labels the three apples individually as apple 1, 2, and 3. Semantic segmentation is an easier problem than instance segmentation and they are the same if there is only one instance of the object.

Where should I be looking to get started?

I do not have experience with Yolo/darknet but have used Mask RCNN. Mask RCNN is written in Python using Tensorflow/Keras and the base version of the code can be found here: https://github.com/matterport/Mask_RCNN. It is fairly straight forward to get running out-of-the-box with little changes needed. Mask RCNN does instance segmentation but I recall it was straightforward to add a background class.
I'd suggest choosing a tool that is meant for the problem instead of hacking a tool to match your problem. You can look into the semantic segmentation network called DeepLab, https://github.com/sthalles/deeplab_v3. This also provides a base version of the code written in Python using Tensorflow/Keras. If you pick either of these tools, I assure you that you will not waste time and believe the setup to be minimal as they both work as is.


How to prove a filter has linear phase response?

Remember that there are four types of linear-phase FIR filters. The filter in your example is a type III filter: odd filter length and odd symmetry. The frequency response of such a system has the form

$$H(e^{j\omega})=A(\omega)je^{-j\omega(N-1)/2}\tag{1}$$

where $N$ is the filter length (number of taps), and $A(\omega)$ is real-valued and odd, i.e., $A(\omega)=-A(-\omega)$. Now it's up to you to show that your filter has the form given by $(1)$. Make use of

$$\sin(x)=\frac{e^{jx}-e^{-jx}}{2j}\tag{2}$$

Note that because of the factor $j$ in $(1)$ and because $A(\omega)$ is odd, there's a phase jump of $\pi$ at $\omega=0$, so the phase is not strictly linear. Such a phase response is called generalized linear phase.


Why does signaling overhead for time synchronization scale up with the number of transmitter nodes in a multiple access system?

Let's look at it a bit more in context:

  Moreover, E-SSA (as SSA) has another major advantage over SA/DSA/CRDSA
  i.e. its truly asynchronous RA nature eliminates the need to maintain
  accurate slot synchronization among all transmitters unlike the case
  in SA/DSA/CRDSA.

  The need for transmitter synchronization is a major
  drawback for large networks as the signaling overhead scales up with
  the number of transmitters independently from their traffic activity
  factor.

  The capacity of asynchronous collision channel without
  feedback was investigated by Massey in his seminal paper together with
  protocols sequences for achieving the capacity boundaries [17].

If I understand well, this is not about frequency locking, but about time slot synchronization: the synchronization occurs on a time scale that is orders of magnitude higher than the oscillator period.

In time division multiplexing, there is a guard period at the end of each time slot where nobody should transmit, both to prevent interference and to allow synchronization.
Because this guard interval is present at each time slot, the sun of guard interval times can be considered to be an overhead that varies with the number of time slots (i.e. for the max. number of users the system is designed for).