texts:
So the $H_1$ and $H_2$ frequency response estimators for SISO systems are defined according to:
\begin{align}
H_1 &= \frac{P_{yx}}{P_{xx}}\\
H_2 &= \frac{P_{yy}}{P_{xy}}
\end{align}
Where $\frac{A}{B}$ is an element-wise division of vectors $A$ and $B$. The $H_1$ estimator should be used when the noise is uncorrelated with the input, and $H_2$ should be used when the noise is uncorrelated with the output. I've been trying to experiment with estimating frequency responses but I end up getting the same result regardless of which of the estimators I use. I first define the cross-spectral density according to:
\begin{align}
P_{xy} &=  X\odot  \bar{Y}\\
P_{yx} &=  Y\odot \bar{X}\\
P_{yy} &=  Y\odot \bar{Y}\\
P_{xx} &=  X\odot \bar{X}
\end{align}
Where $\bar{A}$ denotes the complex conjugate of $A$, $\odot$ denotes element-wise multiplication. Here $Y$ and $X$ are vectors of the same length and the Fourier transformation of the signals $x$ and $y$.
If the definition of cross-spectral density is inserted into the $H_1$ and $H_2$ estimator formulations as described at the beginning of this post I get:
\begin{align}
H_1 &= \frac{Y\odot \bar{X}}{X\odot \bar{X}} = \frac{Y}{X}\\
H_2 &= \frac{Y\odot \bar{Y}}{X\odot  \bar{Y}} = \frac{Y}{X}
\end{align}
And, therefore,
$H_1 = H_2 = \frac{Y}{X}$
The $H_1$ and $H_2$ estimators should yield different results as one is supposed to be used when the noise is uncorrelated with the input and the other with the output (as mentioned above).
However, according to my methodology, they are equivalent, at least according to my definitions and calculations. There must, therefore, be something wrong with my approach, but I can't seem to understand what.
EDIT:
I realised that if one estimates the PSD or CSD without any averaging, i.e., welch or similar the $H_1$ and $H_2$ estimators are equivalent when I implement them. However, when I use welch averaging they are not equivalent. Although the $H_1$ estimator is better than the $H_2$ estimator regardless if there's noise on the input or output.


texts: Can all pass filers have a pole/zero at the origin of the root locus

texts: I came across this root locus diagram in my DSP class. It has a pole at the origin, another pole within the unit circle and a zero just outside the unit circle. I understand that the poles and zeros should be complex conjugates for an all pass filter. So will a pole or a zero at the origin prevent the system from being an all pass?My professor tells me that the pole at the origin is allowed. So that is basically leaving me confused.Can anyone explain how this is possible?


texts: Convert measured spectrum to impulse response

texts:
I am still learning, so please bear with me:
My audio measurement tool exports the measured spectrum of the DUT in the following format:

Frequency [Hz]
Magnitude [dB]
Phase [degree]

It is stored in a simple text file.
I managed already to read the file in Matlab, split the lines into vectors for each column. So I have now a vector for the frequency points, a vector for the magnitude values and a vector for the phases.
Now I want to generate the impulse response from it. I managed already to interpolate the values on a FFT frequency grid e.g. for a 4096-points FFT and that the second half (the negative frequencies) can be obtained with conj(X) and mirrored. That's all clear. So I can run ifft on it.
What is not clear to me is, how to handle the phases.
Can I just write:
X = 10.^(mag/20) .* exp(j*phi/360*2*pi)

with

mag the vector with imported magnitude values in dB and
phi the vector with imported phase values in degree?

Or do I need to apply another conversion to phi? Something that takes the sampling frequency  into account?


texts:
I'm doing a student research project connected with VAD.
And I want to find speech corpora with added noise.
I found many references to the NIST Speaker Recognition Corpora. But unfortunately, all links on main site are already dead.

Maybe someone has this Corpora? Or someone can recommend a good Corpora with noise?


texts: Tracking position and velocity using a kalman filter

texts:
I am using a kalman filter (constant velocity model) to track postion and velocity of an object. I measure x,y of the object and track x,y,vx,vy . Which works but if a add gausian noise of +- 20 mm to the sensor readings x,y,vx,vy fluctuates even though the point is not moving just noise. For location that is good enough for my needs but velocity changes when the point is stationary and that is causing problems with my object speed calculations. Is there a way around this problem? also if switching to constant acceleration model improve on this? I am tracking a robot via a camera.

I am using opencv implementation and my kalman model is same as [1]

[1] http://www.morethantechnical.com/2011/06/17/simple-kalman-filter-for-tracking-using-opencv-2-2-w-code/


texts: z-transform causality properties: negative coefficents are zero ($x[-1]z^1=0$, $x[-2]z^2=0$, ...)

texts:
Let's suppose I have a system:

$$Y(z)=X(z)H(z)$$

If the system is causal, does that mean that all the negative coefficients (example: x[-1]) of the transform for $Y(z)$, $X(z)$, and $H(z)$ are zero?  or does that rule apply only to $H(z)$?  what about $Y(z)$ and $X(z)$?


texts: Given a signal and its Fourier transform, find FS coefficient of the shifted sum of the signal

texts:
Given $x_1(t),X_1(j\omega), x_2(t)=\sum_{k=-\infty}^{\infty}x_1(t-6k)$, find Fourier series coefficient of $x_2(t)$.

Looking up the FT table, I got $X_2(j\omega)=\sum_{k=-\infty}^{\infty}e^{-j\omega 6k}X_1(j\omega)$. Fourier transform can be represented as a summation of FS terms, so FS coefficient of $x_2(t)$, $a_k$, is $X_1(j\omega)$, is this correct?


texts: What is the advantage of MATLAB's filtfilt

texts:
MATLAB's filtfilt does a forward-backward filtering, i.e., filter, reverse the signal, filter again and then reverse again. Apparently this done to reduce phase lags? What are the advantages/disadvantages of using such a filtering (I guess it would result in an effective increase in filter order).

Would it be preferable to use filtfilt always instead of filter (i.e., only forward filtering)? Are there any applications where it is necessary to use this and where it shouldn't be used?


texts:
Can anyone explain me how is a Gaussian filter a low pass filter? It may be a simple thing but I just can't seem to wrap my head around it. Also while applying a low pass filter for bandlimiting (to prevent aliasing), which of the following two is better:
(a) Applying Gaussian filter to the signal.
(b) Applying Box filter in the frequency domain and then
      using IFT on the resultant.
I think option (a) is better because we just convolve the signal with a Gaussian while in option (b) we first need to get the FT, then apply the filter and then convert back using IFT. But what about the quality of the resultant signal?

I'm still a newbie so answers with less jargon will be appreciated.


texts: Dominating frequency in a "clear" 50 Hz signal

texts:
I am trying to find out the dominating frequency of a signal with a frequency of 50 Hz (sampled at 200 Hz - every 5 milliseconds).

The python code I am using to do this is the following (based on this):

import numpy
from numpy import sin
from math import pi

t = numpy.linspace(0, 1, 201)  # 200 Hz sampling rate
y = sin(2*pi*t*50)

fourier = numpy.fft.fft(y)
frequencies = numpy.fft.fftfreq(len(t), 0.005)  # where 0.005 is the inter-sample time difference
positive_frequencies = frequencies[numpy.where(frequencies > 0)]
magnitudes = abs(fourier[numpy.where(frequencies > 0)])  # magnitude spectrum

peak_frequency = numpy.argmax(magnitudes)

The peak frequency I get is 49 Hz, not 50 Hz (what I think I should obtain).

Is this the correct way to calculate the peak frequency? If yes, then can you please explain why this happens? Where is my mistake?

EDIT
Code modified according to SergV's answer:

import numpy
from numpy import sin
from math import pi

Fs=200.
F=50.
t = [i*1./Fs for i in range(200)]
y = sin(2*pi*numpy.array(t)*F)

fourier = numpy.fft.fft(y)
frequencies = numpy.fft.fftfreq(len(t), 0.005)  # where 0.005 is the inter-sample time difference
positive_frequencies = frequencies[numpy.where(frequencies > 0)]
magnitudes = abs(fourier[numpy.where(frequencies > 0)])  # magnitude spectrum

peak_frequency = numpy.argmax(magnitudes)

The calculated peak frequency is still 49 Hz...

EDIT 2:
It seems that the problem was that the positive frequencies were not including 0. After changing the code to

positive_frequencies = frequencies[numpy.where(frequencies >= 0)]
magnitudes = abs(fourier[numpy.where(frequencies >= 0)])

the calculated dominating frequency was 50 Hz (as expected).

This is the magnitude spectrum I get: http://imgur.com/JxhnNc5 It shows that the dominating frequency is 50 Hz. Interestingly, even when, because of the bug, the calculated peak frequency was 49 Hz, the magnitude spectrum was showing the correct dominating frequency (50 Hz)


texts:
I am trying to understand what filter may be suitable for the following HMM:

The signal is a Wright-Fisher one-dimensional diffusion characterised by the SDE

$$dX_{t}=\frac{1}{2}\left(\alpha(1-x)-\beta x\right)dt+\sqrt{X_{t}(1-X_{t})}dB_{t}$$

with unknown parameters $\alpha$ and $\beta$. This process has stationary distribution $\mathrm{Beta}(\alpha,\beta)$. At discrete times Binomial observations are sampled conditionally on the value of the process $X_{t}=x$, $f_{Y_{t}}(y;x)=\text{Bin}(y,N;x)$.


texts:
A person can recognise a large variety of sounds and fairly subtle differences in sound, even if they have only heard the sound once.  Is it possible to recreate this with software, and how?

Consider these two problems:
(1)  You have a recording of a dog bark and a cat meow (same volume).  You then record another bark, how would you go about comparing the sounds in order to tell them apart?
(2)  A person says "Yay" and "Tray".  Similar, but we can all tell the difference.

I have already investigated the following:
(1)  Fingerprinting:  Does not work unless the sounds you are comparing are identical.  So it does not work if a different dog barks.  --- Dejavu Python Package and its GitHub repo
(2)  Generic Voice recognition:  Very inaccurate if the recorded word does not come with context.  Also, dogs and cat's don't speak English.  --- Python Speech recognition package, CMU speech recognition
(3)  Phonetics/ phonemes:  The breakup of a (speech) sound into constituent pieces.  E.g: "word" becomes w ə r d.  It returns rubbish if a sound is just taken out of context. --- Python pocketsphinx library and example code


texts:
What are the peak detection algorithms in existence? I have noisy data, and I would like to implement peak detection for this data. Data is in reverse, actually I am trying to determine the bottom.

Here is a snapshot of the data in Excel. I like to detect both bottoms. I thought about passing the data through a low-pass filter and subsequently do a moving average where I determine the peaks and within the moving average I do another search. I have zero DSP background; this is just a common sense approach. I would like to hear what the experts recommend.


texts: MATLAB band-stop filter design for room reverberation?

texts:
I took acoustic measurements of a room using sine swept method, and I also used Pioneer sc-37 to obtain more accurate data.
I used RoomEQ wizard software and measured the impulse response of the room, and got a long list of coefficients. and the Pioneer helped me to get the Q factor, center frequency, and attenuation.

I`m in need of some help on how to start the filter design using the data obtained.

those are the results I got

frequency

impulse response

Pioneer

I appreciate all comments and suggestions.


texts: Remove Checkered Noise (Pattern) from an Image

texts:
I'm trying to remove what looks like a checkered noise pattern that has been added to an image. Comparing the 2D FFTs

The one on the left is the original, while the middle one is the corrupted one.
I've been trying to remove the added bright spots on the diagonals. The far right FFT is my attempt at isolating the diagonals, which I did with an X shaped filter.

[f1,f2] = freqspace(300,'meshgrid');
Hd = zeros(300);
d = f1 + f2 == 2 * f1;
f = f1 + f2 == 0;
d = f | d;
d = logical(d);
Hd(d) = 0.75;

h = fsamp2(Hd);

However I seem to be unable to isolate the features. Are there any known algorithms for such a process? Isolating directions or points on an FFT.
The MSE of the middle image is 0.0084 and the lowest I have gotten it to is 0.0031. With a combination of a low pass filter and a median filter. However the image was quite blurry and I don't think it would be possible to get it very close to the original after that much information loss.
This is a HW question, so please only give hints.
Here are the two images, noisy and original in that order


texts: High FIR order in time critical classification task

texts:
I have a question regarding filtering (bandpass in my case) as a preprocessing step before a classification task.
The frequency band I am interested in lies between 0.5 - 22 Hz which results in a 6000th order bandpass filter due to the steep slope needed for the highpass.
The phase response is linear and I use the filtfilt matlab function to get a zero phase output.
After filtering I try to classify on sample level, to determine when a certain state of two is present in my data.
My question now is whether the high filter order distorts the time sequence, since the output samples of the filter are a superposition of samples $n$ to $n-5999$?


texts: Smooth (not) equally-spaced signal strength data

texts:
I'm currently trying to reduce the noise in/smooth sampled signal strength data. The context is that I collected data from a transmitting device using bluetooth - the available data is basically a series of timestamps and the receiving signal strength.

The problem: The signal strength fluctuates quite strongly, which is why I want to smooth my data. Actually the data is not equally spaced - some signals get lost, the transmitter has some quirks leading to irregular periods in which signals are sent etc. - but I could aggregate them on a fixed time-period, if that's necessary / recommended.

I read some articles but are still not sure how to approach this. What kind of filter would probably lead to the best results? Kalman, Savitzky-Golay, adaptive, exponential...many to choose from and not enough experience to do so.

What would you recommend?

Thanks for your time!


texts: How to implement Signal transmitted by RF source

texts: I am implementing a research paper, in which i have to implement signal transmitted by RF source in matlab. The equation given in this paper is : $s(n)e^{j \cdot 2 \cdot \pi \cdot f \cdot n}$. Any help in this regard would be highly appreciated.


texts:
Fractional Resampler block in GNU Radio has parameter phase shift but there is a lack of information in which factors user has to provide this parameter (radians, degrees or samples?). There is only an error message providing and info that the range of this parameter should be set between 0 and 1. I have created simple simulation with the fractional resampler block to kinda 'debug' its behavior. There is an 100 length input vector consisting of zeros but one in the middle (50th index). Then there is an interpolatior with the RRC filter. Given 0 phase shift and 1 for resampling ratio the output from the interpolating FIR Filter and Fractional Resampler are not in line, meaning that original signal is delayed by 3 samples and to compensate this phenomena I needed to delay samples by 3 in the branch where Fractional Resampler exists. Question are:

Why 3 samples offset occurs?
How to interpret phase shift parameter from Fractional Resampler block?

I don't know if its relevant information but QT Time Sink has normal trigger set to 0.1.
I am enclosing the flowgraph and the source
https://gist.github.com/marcinsztajn/afe03d05653864b10125fefe7d8b888d


texts:
I am trying to implement Wavelet transform in an embedded environment. The problem I face goes like this:

Two vectors, A and B. A is input samples. B is vector co-efficients.
I take convolution of A and B, call it C.
Now I go back to B and up-sample the co-efficients.
Multiple C with new up sampled signal of B.

Problem is I am constrained to up-sample only C, and not B. Is there a way that I can obtain a result where

conv(upsample(B,2), C) == conv(upsample(C,2), B)


texts:
I am currently studying for an exam for a Speech Processing course I am taking and stumbled across this question in one of the sample exams:

I began to plot the pole-zero configuration placing my poles on the unit circle at points +j and -j as well as placing my zero in the 0.5 location.

When I compared my plot to his, I noticed that he placed the poles instead in the halfway point of the Imaginary axis and was wondering why he decided to place them there?

Here is my professors answer:

Thanks


texts: How can the order of a transfer function be derived from its equivalent state space representation?

texts:
Suppose I have a discrete state space model:

\begin{align}
\theta[k+1] &= A \theta[k] + B u[k]\\
y[k] &= C \theta[k]
\end{align}

I know that the equivalent transfer function can be found by solving

$$
Y(z) = C (zI-A)^{-1} B U(z)
$$

But is there a quick way to determine the order of the transfer function for each input? I.e., the degree of its numerator and denominators, assuming that the dimensions of $A$ will be $n\times n$, $B$'s will be $n \times m$ and $C$'s will be $1 \times n$? (Assuming here there is only one variable being observed.)


texts: Noise from quantization and sampling frequency

texts:
How to estimate if noise of sampled sound signal can be heard? I mean the noise that appear when an analog wave is sampled.

Similarly if I use 16bits, 24 bits, and 32 bits resolution, how to calculate noise in dB. I found this eq. SNR = 6.02*NoBits but I am not certain is it correct.


texts: My signal's base line is around 1. When I apply Butterworth high pass filter with cut off frequency Fc = 2Hz signal's base line drops to 0. My data are from the accelerometer. Is this behavior normal ?


texts: People counting implementation using OpenCV

texts:
I need to implement people counting(head count) into one of the product.
I am able to detect faces and count them but only when the persons are actually looking into the camera, if they are not looking into it they will not be detected.

So, what I want is to an idea about detecting human rather than detecting only face.

I have gone through some algorithm like voila jones etc..but did not get anything useful.

It would be great if someone can share their experience or any code snippet to do so or any algorithm to help me out here.


texts: Phase spectrum: $\mathrm{arg}\mathcal{F}(\omega)$ or $\mathrm{-arg}\mathcal{F}(\omega)$?

texts:
Do we need minus or not?
I need to extract phase spectrum from that thing

$$f(x) = \frac{1}{2\pi}\int_{-\infty}^{\infty} e^{i\omega x}d\omega\int_{-\infty}^{\infty}f(t)e^{-i\omega t}dt$$

I can do it by taking Fourier Transform of $f(x)$, right? And phase spectrum will be:

$$S(\xi)=\int_{-\infty}^{\infty}f(x)e^{-i\xi x}dx $$

$$\Phi (\xi)=-\mathrm{arg}\,S(\xi)$$

I found that in book, but don't understand do we need minus
 before arg or not? I'm looking on different plots and some sources plotting with minus and some without. Help me please


texts: How to find the axial resolution for 5 MHz from the following picture?

texts:
I have read couple sources where one stated that 5 MHz pulse has 0.3 mm axial resolution, and another source stated 0.6 mm, and another stated 0.47 mm. One source said the equation for Axial resolution is 0.5 * (spatial pulse length), and other said 0.5*(pulse duration)*(1.54 u/s).
I am trying to use the following picture to understand how did they reach these values.
I would truly appreciate if someone explained it to me, which equation is the right one? if both are correct, then how would you apply it here?


texts: Difficulties while understanding Convolution

texts:
I have just started convolution sum. I am able to do Mathematical convolution sum. But I am unable to make a figure of it in my mind. So I tried to go through the graphical convolution.
Below is the picture

I understand decomposed part but I don't understand that how each decomposed part is generating x[ 0 ]h[ n ],x[ 1 ]h[ n-1 ]....?

I guess a little help makes me to understand the Convolution sum.
Thanks


texts:
I am doing a simple over-the-air(WiFi 802.11a) test in a shielded chamber involving one Tx and one Rx (around 5 feet).. I need to find the duty cycle given the length of the payload (in bytes), MCS etc.
As far as I understand , duty cycle is time a device spent on channel / total time .
I was going through this paper https://www.academia.edu/15142561/Determination_of_the_duty_cycle_of_WLAN_for_realistic_radio_frequency_electromagnetic_field_exposure_assessment
Where the paper calculates the theoretical upper limit of duty cycle for a given MCS

The payload is 1500 bytes
Max data rate is 54 Mbps

How is the data 248 micro secs in calculations? I am thinking,it should be 222.22 micro seconds (1500*8/54 micro seconds)

can any one please let me know  about it

And If anyone has done such analysis on duty cycles , please do guide me thanks


texts:
I'm trying to construct a binary sequence of length $2^n$. This sequence will be converted to a square signal of $\pm 1$, where 0 produces $-1$ and 1 produces $1$. I want the resultant signal to be as spectrally flat as possible, minimizing the $L^2$ norm of the continuous Fourier transform. Is there a reason to believe that this problem is hard, such as by equivalence to a known mathematical problem like subset sum, or is there a solution I'm overlooking?
Things I've checked are Raskar's sequence, which uses exhaustive search, URA/MURA, and Levin 2007. The best method I've considered is genetic optimization, but I'd prefer an optimal solution over a searched one.
The motivation is that I have a reverb with Dirac delta spikes in pre-defined locations, and must choose a sign $\pm 1$ for each spike. Setting all signs to $-1$ produces a pitch determined by the locations, and setting signs randomly eliminates the pitch. This doesn't quite match the problem statement given above, but I think a solution for the above will lead to a solution for this.


texts: How can a thresholding method in discrete wavelet transform be adaptive and denoising is performed level independent?

texts:
I am a bit confused regarding the thresholding methods and noise estimation options found in Matlab regarding Discrete Wavelet Transform.
Please correct me if I am wrong.
I am understanding that noise estimation options are estimating the noise per scale (level dependent) or estimating the noise per the first level (level independent).
Reading about thresholding methods, SURE or Bayes; for example, we have the option to estimate noise level dependent and level independent with both these methods.
But both of these methods are considered adaptive or subband. So would this adaptability be only true if the level dependent noise estimation is chosen otherwise it will act as a fixed threshold but uses its relevant method of calculating the appropriate threshold?


texts: Using MFCC to an ANN Speech Recognition System

texts:
I'm developing an Artificial Neural Network based Speech Recognition System using MFCCs.

Suppose I have 260 input nodes in the ANN, and this number of nodes corresponds to the number of MFCCs that I will use. During feature extraction the number of total coefficients vary with respect to the duration of the sound file. This poses a problem if the ANN was trained just for 260 coefficients.

So most likely the system will fail if a different sound duration which yields lesser or greater number of coefficients is used to test the Neural Network. My question is how do I go about this problem? I have seen several papers in the net talking about Speech Recognition using ANN but I haven't seen something concerning this problem


texts:
I am currently working on a project which involves measuring the sound produced by the onset of a vapour bubble in boiling water. All the experiments went perfectly well and I'm now trying to obtain a frequency spectrum from the signal.

The sound-pulses produced by the bubbles only last about 40 ms max, simply too short to obtain a decent frequency resolution. That is why I'm measuring a numerous amount of almost identical pulses over a period of 5 seconds. The signal is being sampled at a rate of 100 kHz, which results in 500.000 samples. The interval between the sound-pulses is 95 ms ish as can be seen in the figure of the signal below:

EDIT: Added an additional figure of the signal:

When I create the frequency spectrum of the entire signal, I get this comb-like frequency spectrum with an interval of about 10 Hz between the peaks (which corresponds to the 95 ms time interval, but I would then rather expect a peak at 10 Hz in the spectrum):

I can't really get much information from this spectrum. I do know for instance that there should be a peak at around 167 Hz by looking at the time-domain (there's a small sine wave visible with about 6 ms peak to peak). The envelope of the spectrum does resemble the spectrum of a single sound pulse as shown below (but way less accurate):

The matlab code I used for the fourier transform was:

y_fft = abs(fft(y-mean(y)));
y_fft = y_fft(1:Nsamps/2);
f = Fs*(0:Nsamps/2-1)/Nsamps;    %Prepare freq data for plot

Does anyknow how to get a usefull spectrum in this situation or please tell me what I'm doing wrong?

Thanks in advance,

Marc


texts: Efficient FFT computation of a zero-padded vector

texts:
I don't think this question has a good answer but will ask nevertheless since it has been bothering me for a few days.

I am interested in computing as efficiently as possible the N-point FFT of a N/2 vector that has been zero-padded with N/2 zeros.  (I am actually interested in doing the same for vectors zero-padded with many more zeros but let's discuss the simplest case simple here.)

A simple obvious optimization consists in skipping half of the computations in the first FFT stage which correspond to multiplying a zero input value by a twiddle factor.  One could further skip a quarter of the computations that have zeros in the second stage, and so on, but the savings quickly dwindle down.

I was hoping we could do better.  After all, an FFT of a zero-padded vector is essentially a sinc interpolation of a smaller FFT taken on the non-zero smaller input vector.

In fact, writing down the math shows exactly that.  If I call the FFT of the non-zero N/2 vector y, the FFT of the zero-padded vector ypad, @ represents the circular convolution, and SINC the N/2 FFT of the first N/2 twiddles of an N-point FFT, we have:

ypad[2k]   = y[k]
ypad[2k+1] = ( y  @ SINC )[k]

Problem is: computing the circular convolution of y by the SINC function for each odd point is very costly and doesn't lead to a faster implementation that computing the N-point FFT.  My last hope is that once we have computed the circular convolution in one point, the circular convolution for other points can be derived with fewer computations, but I currently don't think so.

Has anyone an idea on how to compute efficiently the N-point FFT from the N/2-point FFT of the non-zero vector or is that a dead end?


texts: When is the Correlation Coefficient Ergodic

texts: Given Wide Sense Stationary (WSS) processes X and Y that are ergodic to the mean and autocovariance. Under what conditions is the correlation coefficient ergodic to the mean? ie: $lim_{T->\infty} \frac{1}{T} \int_0^T X(\tau)Y(\tau) d\tau$ converges to E[X(t)Y(t)]=constant


texts:
making pink noise (1/f) using list of frequencies

I would like to see what type of noise I would get if I used just the frequency in my voice.  I created a matlab array using fft to get the
[frequency,amplitude,phase] to reproduce my vocal signal.

I would like to take this file/data and use it to create pink noise (1/f).  Of course when I use 1/f for the frequency the numbers become very small does anyone have any ideas how to use my own vocal frequencies that I get from doing a fft in matlab from my voice to create pink noise (1/f).

Thanks


texts: How to calculate power of a signal at one specific frequency?

texts:
Given a signal, $s(t)$, sampled at frequency $f_s$, how does one calculate the power of the signal at one specific frequency $f_q$?  Since I am only interested in the power at $f_q$, computing the FFT seems like over kill.
I can identify the following pre-existing content on stackexchange:

This post effectively suggests Goetzel's algorithm.  There is a pre-existing MATLAB function which appears to provide what's needed.

This post suggest band-pass filtering the signal then taking the sum of the squared signal.  This seems to make sense to me but I wonder how selective the band-pass filter can actually be given the sync-like frequency content of the windowing function.

This post deals with power in a specific signal band with suggestions of using MUSIC, goertzel, etc.

My interest is not in a frequency band but the power at one specific frequency.  My thought is to convolve a sinusoid whose frequency is fq with the signal and then summing the power in the resultant signal (a matched filter).
I would have thought there would be a more straightforward solution but I struggle to find the words to start an effective literature review.


texts: What is the effect of a sawtooth phase mask in the frequency domain?

texts: We know that a linear phase ramp in the frequency domain corresponds to a time shift in the time domain. Qualititavely, it seems a sawtooth phase mask in the frequency domain could produce the same time shift effect as the linear phase ramp, but I need help with the mathematical derivation to see what the actual effect is.


texts: Why FFT of a rectangular pulse has imaginary part while the sinc function is real?

texts:
I have a rectangular pulse:

w = 20; pln = 10;
v =[zeros(1, pln), ones(1, w),zeros(1, pln)];
figure(); plot(v,'-o');

by perform fft and fftshift the pulse center to zero to get its frequency domain representation:

yf = fftshift(fft(v));
xf = [-0.5000   -0.4750   -0.4500   -0.4250   -0.4000   -0.3750   -0.3500   -0.3250...
-0.3000   -0.2750   -0.2500   -0.2250   -0.2000   -0.1750   -0.1500   -0.1250...
-0.1000   -0.0750   -0.0500   -0.0250         0    0.0250    0.0500    0.0750...
0.1000    0.1250    0.1500    0.1750    0.2000    0.2250    0.2500    0.2750...
0.3000    0.3250    0.3500    0.3750    0.4000    0.4250    0.4500    0.4750];
yf = yf.*exp(-2j*pi*xf*(pln+w/2)); % this shifts the time domain signal to zero

yf is close to the sinc function - the Fourier transform of a rectangular function - but not exactly the same, it has imaginary part while sinc is is purely real:

yf_sinc = w*sinc(w*xf);

Why is the difference and why ifft of samples taken from a sinc function will not produce an exact rectangular pulse but with ripples close to the edge while ifft(fft(v)) will exactly reproduce the original rectangular pulse:

% has ripples around the edges
figure(); plot(fftshift(ifft(fftshift(yf_sinc))));
% reproduces the exact rectangular pulse
figure(); plot(fftshift(ifft(fftshift(yf))));

herer yf, if we assume it was directly sampled form a underlying function, that is ingoring the fact that it is produced by fft of a rectangular pulse (it's just some numbers anyway), what function would it be? Is it possible by sampling a function in the frequency domain (not need to be the sinc function) and take the ifft will produce an exact rectangular pulse?


texts: What would be the variance for complex number?

texts:
When $x$ is a zero mean random variable then

$$\sum_{n=1}^N x_n x_n^T = N \sigma^2_x\,\text,$$

where the variance is $\sigma^2_x$.

I'm considering Complex Normal Distributions where the real and imaginary part are uncorrelated.

https://en.wikipedia.org/wiki/Complex_normal_distribution explains about the form of the distribution for complex normal distribution.

I have a confusion because the denominator for the real case in the distribution has a 2 but for the complex that is not there.

Does this mean that if $x$ is a complex valued random variable, then the variance becomes half i.e.,
$$\sum_{n=1}^N x_n x_n^H = N \sigma^2_x/2\,\text,$$
where the variance is $\sigma^2_x/2$ because the variance gets equally distributed in the real and imaginary component?

I have this doubt because when implementing, if I need to generate a complex noise of variance 1, I would be doing (in Matlab)

noise = sqrt(1/2) * (randn(N,1) + 1j*randn(N,1))

Since each component (real and imaginary) needs to have variance 1/2, such that their sum becomes 1.

So, the variance $\sigma^2$ is half mathematically. Is my understanding correct?

UPDATE based on valuable information provided under the comments : I am considering at the circularly symmetric complex normal distribution, where real and imaginary part are completely uncorrelated.


texts: Map time/scene differences between two similar videos

texts:
Goal:
Given two videos that are episodes from series but in different format (one Bluray/one TV for example), map the time differences between the two (which scenes are not in one of the two) and be able to compensate for some subtitles lags between version.
Current state:
I've began something thanks to this question (Map time difference between two similar videos) and started building a python script so now I'm able to transform each frame of each video to a one floating point value.

The problem is now, I dont know how to detect those lags as you can see in the picture. I'm trying some cross correlation maybe with some window but I'm not sure of how I should handle the added scenes in both signals (which means here signal that cannot be correlated).
Questions:
Do you know any algorithm/method that can help me with this process ?
Do you know what the user in this thread (Map time difference between two similar videos) means by "added a Gaussian of that length with amplitude as the phase difference to the mapping (at the appropriate interval)" ?
Thanks for your help !


texts: Does whitening with PCA correspond to power spectrum flattening?

texts:
I'm finally making some headway in understanding data whitening, but I have a question now relating what I think of as "data-based" whitening to the situation where there are time-varying signals.

So in the "data-based" world, suppose I have a mean-centered column matrix $X$ with covariance $\Sigma = \mathbb{E}[XX^\top]$. This data matrix can be transformed into a whitened dataset $W$ by computing $W=\Lambda^{-1/2}EX$, where $\Lambda$ and $E$ are the eigenvalues and eigenvectors of $\Sigma$.

So far, so good. What I'm curious about is, what if my data vectors are a bunch of windowed snippets of audio (for example) ? I could use the DFT to compute a mean power spectrum for these snippets, and then rescale each snippet by the inverse of the spectrum at each frequency. If I understand correctly, this would whiten the power spectrum of my dataset.

Does this process equate to whitening in the "data-based" world above ?

If so, are the eigenvalues of the data covariance (which I understand are also referred to as a spectrum) directly related to the mean power spectrum of my signals ? How ? Any pointers to good reading on the subject would be very welcome.

Sorry if this is an elementary question, but I haven't had much signal processing background and find this to be really fascinating.


texts: Detection milliseconds signal using a DVB-T dongle as SDR in C (need idea)

texts:
I have probably amateurish problem. Assume that we have a USB tuner DVB-T + connected antenna.

I would like to write a program that will detect the signals of at most a few milliseconds.

Signal looks classically as follows:

Someone can help me how to do it? I want to write it in C.

Edit: I do not need, of course, the final code. I need ideas.

Edit-2:

I add details of the signal:

Frequency: approx. $850 MHz$ (may be more)

The measurement of dispersion: $> 250 pc.cm^{-3}$

The length of the signal: $> 0.01 ms$

Peak Flux: (I'm not sure what value we can get)


texts: How to detect if a signal raises sharply or slowly?

texts:
so how can i detect if a signal raises sharply or not ? Are there easy solutions (i suppose there are) ?

the problem is that if a signal raises sharply, i need less data to not pollute the dataset and if the signal raises slowly then i need more data. But how to determine the number of data, without knowing if it's sharp or not?

Also I need to know if it raises sharply when i'm at the top of the curve, NOT afterwards (in realtime if you want)

thanks so much

here is two examples of signals
http://khaelis.com/downloads/screenshotSharp.jpg
http://khaelis.com/downloads/screenshotSlow.jpg

Jeff


texts: how to compute horizontal angle of a pixel from a computer vision camera

texts:
My program needs to compute the angle of a pixel from a computer vision camera that has 120 degrees field of view, and resolution of 640 pixels wide and 480 pixels high.

Program receives an X,Y array of pixels for each image frame from camera. For left-most pixel, X would be 0 and angle would be -60 degrees. For right-most pixel, X would be 639 and angle 60 degrees. For center pixel, X would be 320 and angle 0.

How is angle computed when (X is > 0 and < 320) and (>320 and <640)?


texts:
Suppose I have an image of a cat and a binary mask image corresponding to cat's location as shown

I would like to blur the image region surrounding the cat but as a function of distance from the cat's boundary pixels. Essentially, the further a pixel is away from the boundary, the greater the degree to which it gets blurred. The ideal distance measure would be iso-contours which extend radially from the cat's boundary pixels, but this is possibly complicated. I would settle for Euclidean distance for now.

Any idea how I can accomplish this ?


texts: Suppose wind direction is from point A to point B and some sound source like glass shattering is at point B, will sound waves going to point A be affected by that wind coming in opposite direction, or will the sound waves cut right through?


texts: ADC sampling rate implications Matlab/Simulink M-PSK modulation

texts:
I am trying to find a way to evaluate what would be the minimum sampling rate used in a modulated waveform using matlab / Simulink.

The real scenario would be let say a M-PSK waveform of Y bandwidth in baseband reaches the point of the ADC and has to be sampled. Theoretically, the sampling rate should be 2xY and that (in ideal conditions) would allow you to restore what has been sampled.

In matlab/Simulink everything is “digital” meaning that we deal with waveforms produced by using random numbers generators. In such case by trying to introduce the process of sampling can only be realised as effectively down - sampling an existing waveform.

Shall I try to reproduce a more “continuous time” approach to get better estimates?

What is the usual coarse of action for such a problem?


texts:
The Laplace transform is a generalization of the Fourier transform since the Fourier transform is the Laplace transform for $s = j\omega$ (i.e. $s$ is a pure imaginary number = zero real part of $s$).

  Reminder:

  Fourier transform: $X(\omega) = \int x(t) e^{-j\omega t} dt$

  Laplace transform: $X(s) = \int x(t) e^{-s t} dt$

Besides, a signal can be exactly reconstructed from its Fourier transform as well as its Laplace transform.

Since only a part of the Laplace transform is needed for the reconstruction (the part for which $\Re(s) = 0$), the rest of the Laplace transform ($\Re(s) \neq 0$) seems to be unuseful for the reconstruction...

Is it true?

Also, can the signal be reconstructed for another part of the Laplace transform (e.g. for $\Re(s)=5$ or $\Im(s)=9$)?

And what happens if we compute a Laplace transform of a signal, then changing only one point of the Laplace transform, and compute the inverse transform: do we come back to the original signal?


texts: Any better way to detect Signal with ADC Overflow problem?

texts:
I am trying to create an algorithm to detect signal with "ADC overflow" as shown in picture on lower right. It happened because someone had incorrectly down converted an int16 signal into int8 signal. The sampling rate of the signal was 1000Hz, about 2 minutes in duration and has bandwidth up to 300Hz due to low pass filtering. I have few thousands of them and the "ADC overflow" could happen at any place. I need to quickly identify those signal and their overflow locations.

So far I use this technique but it is not robust enough, because I have to keep lowering the threshold=0.8 for higher frequency signal. It's also very hard to differentiate random noise from ADC overflow. Does anyone has better way to do this? Thanks

# Python
# y = int8 signal with ADC overflow as shown on the right
diff = np.abs( np.diff( y.astype(np.int64) ) ) / 255
overflow_loc = (diff >= 0.8)   # <-- 0.8 may not work for high freq signal
overflow_loc += np.roll(overflow_loc, 1)
loc = np.where(overflow_loc == 1)[0]

Ok I tried the Histogram method, but I still can not tell the different. Here is my Python code and output. Please enlighten...

freq = 10
x = np.linspace(0, 1.0 / freq, 256)
y = 1.1 * 127 * np.sin(2 * np.pi * freq * x)
yo = y.astype(np.int8)

fig, axs = plt.subplots(2, 2)

axs[0, 0].plot(x, y)
axs[0, 0].set_yticks([-128, 127])
axs[0, 0].plot(x, [-128] * len(x), '-.')
axs[0, 0].plot(x, [127] * len(x), '--')
axs[0, 0].set_title('ideal signal (np.float64)')

axs[0, 1].hist(y, bins=200)
axs[0, 1].set_title('amplitude histogram (ideal signal)')

axs[1, 0].plot(x, yo)
axs[1, 0].set_yticks([-128, 127])
axs[1, 0].plot(x, [-128] * len(x), '-.')
axs[1, 0].plot(x, [127] * len(x), '--')
axs[1, 0].set_title('overflow signal (np.int8)')

axs[1, 1].hist(yo, bins=200)
axs[1, 1].set_title('amplitude histogram (overflow signal)')

plt.show()


texts: Varying signal bandwidth with two signal generators

texts: I would like to emulate a signal with bandwidth (like BPSK) for some testing, but the two signal generators I have access to do not have any BPSK options installed.  If I know the frequency (2462MHz) and the bandwidth (16MHz) I want, is there a way to mock this up easily with two signal generators?  I feel like this isn't a hard problem, but I am drawing a blank.


texts: Why is oversampling helpful to an anti-alias filter?

texts:
Why does oversampling make the job of an anti-alias filter easier? I don't understand the intuition on why it becomes helpful.

Isn't it economical to just keep the sampling rate at the minimal level, that is twice the highest frequency of the signal, in that way, we can save energy, and processing and computational power.


texts:
Please refer to the paper Splitting the Unit Delay - Tools for fractional delay filter design by Laakso, Valimaki et.al.
I am not able to visualize how the fractional delay is obtained by resampling the shifted version of the impulse response of the ideal filter as described in the following para.

When the desired delay D assumes an integer value, the impulse
response Eq. 12 reduces to a single impulse at n = D, but for
noninteger values of D the impulse response is an infinitely long,
shifted and sampled version of the sinc function (Fig. 3).
Unfortunately, the ideal impulse response is not only infinitely long
but also noncausal, which makes it impossible to implement it in
real-time applications.
Equation 12 gives an answer to the original problem, i.e., where the
delayed signal value should be placed as it cannot be put "between the
samples." In the ideal case, it is to be spread over all the
discrete-time signal values, weighted by appropriate values of the
sinc function.

Also, suppose the minimum unit delay supported by a system is D, can we derive fractional delays lesser than D with this technique or only greater than D? Does this in any way overcome system limitation w.r.t minimum tap delay resolution(splitting the unit delay as the name suggests)? Or is it  only useful for implementing fractional or irrational rate conversions within bounds of the hardware?


texts: Are there alternatives to the bilinear transform?

texts:
When designing a digital filter based on an analog filter we usually use the bilinear transform. To approximate a discrete transfer function $D_a(z)$ from analog (continuous) transfer function $A(s)$ we substitute

$$z = \frac{1+sT/2}{1-sT/2}$$

where $T$ is the sampling period. Alternatively, to approximate an continuous transfer function $A_a(s)$ from discrete transfer function $D(z)$ we substitute

$$s = \frac{2}{T} \frac{z-1}{z+1}$$

Are there alternative methods of performing such conversions? Are there better approximations?


texts: Combining Bandpass filters on 1D signal to obtain better SNR?

texts:
I have a signal which I'm trying to extract information from (specifically, features to recognize using DTW). Parts of it have very clear and unique features which are unfortunately only sometimes superimposed with a higher frequency low power interference. Below is an example of a square wave feature.

In this picture,

Black line represents the original signal.
Blue line is a lowpass Butterworth filter (I have added 3 to the value so that the graph looks more legible).
Red line is the signal minus the result of a highpass filter (again offset by +5). And the
green line is a simple box smoothing filter (specifically [1,3,5,7,9,11,9,7,5,3,1]) on the original signal.

The blue line in the second graph is the high pass filter's result.

My questions are: is there any way to disentangle what appears to be a very crisp square wave from a very periodic hum? This hum isn't mains hum, by the way, and it isn't always the same strength or frequency. When it comes on, it'll remain constant all along, but the next time it comes on, it might be a different frequency.

I'm a bit disappointed that I can't get a result that's better than my box filter without severely distorting the resulting signal into something that barely resembles a square signal. Already the low pass filter result (blue graph) is starting to move well past square.

I've gone so far as to thinking of picking the dominant high end frequency, and creating an artificial sine wave to try and "manually remove"  the hum. Is this completely misguided? And what hope do I have of getting a clear signal if I won't have the luxury of fine tuning my filters at design time?

I appreciate any general recommendations.

Edit 2:

Here's a functional equivalent to my problem in python. Any comments as to why I'm not obtaining a clean output signal? I've played around with the cutoff values but I'm not very familiar with signal processing so I'm not sure if I'm approaching it right.

length = 1200
frequency = .00259
interference = 0.0237
interference_amplitude = 0.2

def iirfilter_filter(data):
        nyq = 1/2
        bottom = interference/nyq
        top = interference*10/nyq
        b, a = iirfilter(10, [bottom,top], rs=60, btype="bandstop" , analog=False , ftype="cheby2" )
        return lfilter(b,a, data)

time_series = np.linspace(1, length, length )

sine_wave = np.sin(2 * np.pi * frequency * time_series )
square_wave = (sine_wave / abs(sine_wave))

sine_wave = sine_wave + (interference_amplitude * np.sin( 2 * np.pi * interference * time_series ) ) - 1
square_wave = square_wave + (interference_amplitude * np.sin( 2 * np.pi * interference * time_series ) ) + 1

noisy_sine_wave = sine_wave + ( numpy.random.rand(length) * interference_amplitude)
noisy_square_wave = square_wave + ( numpy.random.rand(length) * interference_amplitude)

a = plt.subplot(2,2,1)
b = plt.subplot(2,2,2)
c = plt.subplot(2,2,3)
d = plt.subplot(2,2,4)

a.plot( sine_wave )
a.plot( square_wave )
b.plot( iirfilter_filter( sine_wave ) )
b.plot( iirfilter_filter( square_wave ) )
c.plot( noisy_sine_wave )
c.plot( noisy_square_wave )
d.plot( iirfilter_filter( noisy_sine_wave ) )
d.plot( iirfilter_filter( noisy_square_wave ) )

plt.show()

Output:


texts: What's the ideal FFT window for measuring a group of signals of differing amplitudes but close in frequency?

texts:
In my system, I need to measure the amplitudes and phases of four lasers, each of a different, known wavelength, chopped at a 50% duty cycle via TTL at frequencies spaced evenly (or not) around some fundamental frequency f0. The lasers are attenuated by some analyte medium, and the resulting laser power (which is measured by a single detector) tells me what I need to know about the medium.
The signals are recovered by performing I/Q demodulation. The application is similar to the one in this question. The signals' individual frequencies can be controlled by me, but should not be more than 6-7 Hz away from f0.
In single-signal applications of my setup, I've used the Exact Blackmann window, which is known to be good for single-frequency measurements, at least according to National Instruments. My question is, is there a more robust choice for recovering four extremely close signals?
Other details: sample rate is 8192 or 16384 Hz for two seconds, f0 is in the neighborhood of 1230 Hz. Typically I have the frequencies evenly spaced, at f0±6 and f0±2, so they're all 4 Hz apart. The input signal is demodulated and windowed four times, once at each of the frequencies of the lasers. Followup question: could spacing them unevenly help?


texts: How to equalize an ISI channel when the transmitted symbols are unknown?

texts:
I am using MATLAB to simulate transmission of binary data sequence, $\mathbf{x}={x_k\in\{+1,-1\}\forall 0\leq k\leq N}$, over an ISI channel whose impulse response $\mathbf{h}=[h_0 h_1 \cdots h_{\mu}]$ is perfectly known. My channel observation sequence is $\mathbf{y}$ is a noisy version of filtered $\mathbf{x}$ that can be expressed mathematically as

$$y_k=Hx + w_k,$$

where $w_k\sim\mathcal{N}(\mu,\sigma_w^2)$.

For such system, equalizers can be designed to mitigate the effect of ISI. This often includes computing quantities like autocorrelation matrices $R_{xx}=E[x^{}x^T]$ and $R_{yy}=E[y^{}y^{T}]$, and cross correlation $R_{yx}=E[y^{}x^{T}]$

In MATLAB, I have access to $\mathbf{x}$ and I know noise variance $\sigma_w^2$ so computing $R_{xx},R_{yy},$ and $R_{yx}$  is straight forward.

My question is how do we compute such quantities in practice when we only have access to $\mathbf{y}$, our channel observation and  we don't know what input sequence $\mathbf{x}$ is?


texts:
I have been given a sinusoidal signal x in time domain,asked to investigate the frequncy responce of the signal using matlab and observing the result,and using grpdelay(x,1) command in matlab to observe the group delay of the signal .and taking y=conv(x,x);which define the convolution of x signal by itself and then asked to use the grpdelay(y,1).
My question here is what change should I exspect to see in group delay figure of conv(x,x)?
or better to say how convolving of the signal by itself would effect the group delay of the signal.
Thanks


texts: Why are LTI systems defined by convolution, why not in any other way?

texts:
I am curious about why are LTI systems defined by convolution, why not in any other way?
This Might be silly question but I want to know that.

Also why polynomial multiplication is convvolution?


texts: Does anyone know how and when and where used Legendre polynomial?

texts:
I'd like approach to Legendre polynomial.
But i don't make concept with Legendre polynomial.
So if you know where and when does L.P used and how L.P used, would you please let me know about this? To more understand it.

Hmm.. specifically in the application.


texts:
Firstly, the context: I've been given a signal in a wav file, the sampling rate and carrier frequency along with the fact it is Manchester encoded and has been ASK Modulated. Five periods of a sinusoidal wave at half frequency of the carrier denote the end of a 'row' and a parity column/row is added. From this I am to reproduce a 300x300 black and white image. My main tool I've been given (never used before) is MatLab. This IS an assignment, and I'm just looking for some answers that I can't find clearly elsewhere.

So, from what I understand I've got this y[t], which is equal to x[t]*cos(2*pi*1000*t). From this signal I need to try and get x[t] out, then decode it. One of my issues is how to go about extracting this signal.

Sorry for the long start, and if any of this seems basic. It's an introductory course that just throws us in the deep-end all of a sudden!

Question 1: As this is ASK after Manchester Encoding, I'm guessing each 'bit' will be represented by a group of values from the sample that go from either positive to negative or negative to positive? Is my guess correct?

Question 2: In the samples, there are exactly five (or six, I've forgotten at present) zeros between each group of four non-zero numbers (except at the parts which I'm guessing are the five periods denoting the end of a row). Would these zeroes be useful in the demodulation, or are they just introduced during the sampling phase and not useful for demodulation?

Question 3: So, assuming the above questions are correct. To demodulate this signal, would I simply remove all the zero values, then iterate through and denote a '1' when it is positive and a '0' when it is negative (maybe some additional value for when the end of a row is encountered), then pair it up so 10 -> 1 and 01 -> 0?

Many thanks for any help, and sorry once more about the length!


texts:
I need to interpolate a complex valued bandlimited periodic function using local interpolation.

I can have the signal sampled at any frequency I want over at equispace intervals.

I am aware that for bandlimited periodic functions the best interpolation method is global interpolation (FFT).

However, for this project I need to use local interpolation.
I managed to perform the interpolation using Lagrange polynomials of order 10 but I require an oversampling of 2 to achieve the desired results.
My goal is to reduce oversampling to any extend even if I need a longer interpolator.

I recently read as much as I could about FIR filters but somethings are not clear to me.

Since the interpolation factor is of the order of 2, I am planning to use a halfband pass interpolator (many books say this is the best since one gets a cheap interpolator due to the zeros in the impulse response).

My questions are:

How do I design a halfband pass filter? In Matlab there are nice functions in the dsp package that allow directly to construct such filters, unfortunately I have to do this implementation in C. I searched and I found that the remez() function from Octave to compute the coefficients is available in C and is the one I am planning to use.
Designing a low pass filter with the Parks-Mclellan algorithm is it by default a halfband pass filter (provided I set up correctly the frequency bands) or do I have to enforce the time domain constraints?
Regarding the linear phase of the FIR filter, what I understand is that my signal will be shifted by some samples, how do I compensate to remove the shifting? What comes to my mind is to apply the corresponding shifting on the opposite direction, is this necessary?
If you could provide an working example of an interpolation of a periodic function (e.g. sum of sines) using a FIR I would be very grateful.


texts:
I have a problem with SIFT that I do not understand. Lowe [1] proposed in his work the s=3 levels of scale are enough for one octave. Afterwards, he mentioned that you need to compute s+3 levels.

Why there are 3 and not 2 additional levels required. I understand that you require one additional level above and one additional level below the scales since you search for extrema in neighbored scales.

For what is the third additional level of scale?

Thank you very much in advance!

[1] Distinctive Image Features from Scale-Invariant Keypoints
    D. G. Lowe
    Int. Journal of Computer Vision 60(2) (2004), pp. 91--110


texts: Is it possible to do better than Cramér Rao lower bound for different estimation methods

texts:
I’m new to learning about the Cramér Rao lower bound. Does the calculation of the CRLB imply that only particular estimation algorithms can be used (e.g. estimating delay and Doppler from a complex ambiguity surface) which satisfy the CRLB inequality? And, if I have additional algorithms to refine those estimates and get higher precision ones, could I ever do better than the CRLB?

Or in other words, does the CRLB always hold for any possible algorithm I come up with to compute/estimate the quantity of interest?


texts:
Reading the signal literature I often come across the expression $k \delta (t)$ where $k$ is a constant. I presume this is a notation to suggest we are referring to the area or strength of the Dirac function since the multiplication of a constant, $k$, by $\delta (t)$ seems to make no sense.

My question is what does $k \delta(t)$ mean? Am I correct in assuming that on its own it doesn't represent $k$ multiplied by $\delta(t)$?


texts:
I am using a 3-axis LIS2D12H accelerometer interfaced with NRF51832 through the SPI interface.

The sensor has a sampling-rate from 1 Hz to 5.376 KHz which is happening at sensor only.
I am taking sensor data at 400 Hz by setting register values in the sensor.
I am implementing an FFT algorithm in microcontroller over a raw sensor data received by the 3 axes, for vibration analysis.

I can have resolution of FFT from 64 to 2048.

Q: My confusion is how should I sample it at microcontroller for FFT? There are FFT functions in ARM cortex which I am using.

Shall I take raw samples in buffer and sample them or shall I take each reading from sensor and sample them individually?
If that is the case how shall I select sampling frequency at microcontroller level and/or at what rate microcontroller shall read data?


texts:
I hear the word warp a lot, but cannot quite get a feel for what it really means
I suppose it's literal meaning would be to change in shape, but what does it mean with respect to DSP?
More specifically, I have a DSP chip manual that says a certain parameter adjusts warp for DACs and another one that adjusts warp for ADCs. What does warp mean in this context?
If possible, please explain it without technical jargon.


texts:
My question has to do with the definition of auto correlation/cross-correlation for random processes.
Oppenheim/Schafer (Discrete time Signal Processing, Pg. 815 (Appendix A.2),2nd ed.) define auto correlation in the following way:
$\phi_{xx}[n,m]=E[\mathbf{x_nx^*_m}]=\int_\infty^\infty x_nx^*_m p_{x_n,x_m}(x_n,n,x_m,m)dx_ndx_m$

{$\mathbf{x_n}$} is a random process and $p_{x_n,x_m}(x_n,n,x_m,m)$ is it's joint probability density function.
What is the significance of using the conjugate of $x_m$ in the above formula? Is there a physical interpretation for it?


texts: Validity of applying Heaviside function for signal processing applications

texts:
I wasn't sure if this question was more suitable for math.stackexchange, but I suspect it's more-so a signal processing question (albeit, a theoretical one) than a mathematical one.
I am currently studying the textbook An Introduction to Laplace Transforms and Fourier Series, second edition, by Phil Dyke. Chapter 2.1 Real Functions describes Heaviside's unit step function as follows:

Sometimes, a function $F(t)$ represents a natural or engineering process that has no obvious starting value. Statisticians call this a time series. Although we shall not be considering $F(t)$ as stochastic, it is nevertheless worth introducing a way of "switching on" a function. Let us start by finding the Laplace transform of a step function the name of which pays homage to the pioneering electrical engineer Oliver Heaviside (1850 - 1925). The formal definition runs as follows.
Definition 2.1 Heaviside's unit step function, or simply the unit step function, is defined as
$$H(t) = \begin{cases} 0 & t < 0, \\ 1 & t \ge 0. \end{cases}$$
Since $H(t)$ is precisely the same as $1$ for $t > 0$, the Laplace transform of $H(t)$ must be the same as the Laplace transform of $1$, i.e., $1/s$. The switching on of an arbitrary function is achieved simply by multiplying it by the standard function $H(t)$, so if $F(t)$ is given by the function shown in Fig. 2.1 and we multiply this function by the Heaviside unit step function $H(t)$ to obtain $H(t)F(t)$, Fig 2.2 results. Sometimes it is necessary to define what is called the two sided Laplace transform
$$\int_{-\infty}^\infty e^{-st} F(t) \ dt,$$
which makes a great deal of mathematical sense. However, the additional problems that arise by allowing negative values of $t$ are severe and limit the use of the two sided Laplace transform. For this reason, the two sided transform will not be pursued here.

What I'm having difficulty understanding is how this procedure is valid from a signal processing perspective. Mathematically, we can see that by applying the unit step function, all values of the function for $t < 0$ become $0$. This is valid from a mathematical perspective, but it seems to eliminate all of the information associated with values $t < 0$, which leads me to wonder, since the unit step function is used for signal processing applications, how this is valid from a signal processing perspective? Couldn't values of the function for $t < 0$ contain valuable information, and aren't we deleting this information when applying the Heaviside function to this function?
I would greatly appreciate it if people would please take the time to explain this.


texts:
I was planning to develop Android / iOS applications that enable users to measure 3D length using their smartphones.

According to this question, you need to know at least the time-varying bias that affects the accelerometer's signal. Hence, I need to estimate the bias every time a user is going to measure. How can I do that? I've seen articles about this estimation but to be honest I'm not expert in signal processing so I didn't understand them. Can you explain a method to estimate?


texts: How to match a drawn Chinese character to a database of stroke animations

texts:
I have a database of Chinese character stroke animations. Each entry is basically a set of points which shows how and in which order a character should be drawn.

To make lookup easier, I would like to allow the user to manually draw a character with the mouse, then my software would propose some possible matches (like it's done on the iPhone).

I searched on Google but didn't find anything relevant. I'd like to know what algorithms or research paper I need to look at. I guess it has something to do with shape recognition, except that the order in which the shape (Chinese character) is drawn is also relevant. Any suggestion?


texts: Do Audio Interface manufacturers use A-weighted Measurements to make specs look better?

texts:
Recently I came across a reputed music-tech teacher who said audio interface manufacturers use A-weighted measurements to show dynamic range in their specs so that they look better on spec sheets and to hide noise in some frequencies. He also said the A-weighted measurements are not used to measure audio interfaces and advised against buying any audio interface that has A-weighted measurements in specifications. Then I was looking at some really high end audio interfaces and noticed they're also displaying their specs in A-weighted measurements.

So what's the real deal about this? Is it fair to say an audio interface is bad just because A-weighted measurements are used in specs?


texts:
I am having trouble identifying the frequency components of an image,
Here I simply generated, 256x256 binary-image.
a = [zeros(256,128) ones(256,128)];
imshow(a);

Taking the image FFT and shifting the Zero-frequency to the center,
f = fft2(a)
shft = fftshift(f);
imshow(log(shft)) %stretching

will result,

How do I identify how many frequency components are there and what are those frequencies?
Also if I calculate FFT of any 1-D sequence and plot that sequence there are certain values on negative, what does that mean? How could there be negative frequencies?


texts: Scratch Detection On Noisy Textured Surface

texts:
I wish to extract long thin scratches from the noisy background image.I have tried several ways such as stacking smoothed image with input image to remove some of the noisy background patch before applying blob detection filtering on those images to get the long thin scratch. However, overkill will happen due to the noisy background patches.

Any good suggestion or guidance on other things to try?


texts: Downsampling vs. ADC with lower Sample-Rate

texts:
I would like to know in general where the advantages and disadvantages are:

Downsampling of a high sampled continuous analog signal in FPGA or µC and
Direct use of a lower sampling rate, i.e. using an analog to digital converter with a lower sampling rate ?
Are there any differences or does it have the same effect ?
Because almost every DSP-System i see uses a way Oversampling followed by Decimation (Downsampling + AAF-Filter) instead of adequate Sampling Rate without Decimation.

Greetings


texts: How to know when a sound in a given frequency starts and ends?

texts:
I need to detect two sounds (913 Hz and 1370 Hz), knowing the time in which each starts and ends.

At this time, I am using a band pass filter (butter), and this is the result:

Here is the first time this sound occurs:

The red line is where the sound is supposed to end (276 ms).

So how can I detect that the first time the tone occurs it starts at 0 ms and ends at 276 ms?


texts: How to find if the signals are in sync or out of sync with each other?

texts:
Considering these are two signals over time, black and red.Following are some of the properties

Every Second a new data point is added over time . There is no control on the generation of the signals/how the signals are generated. Cannot nail down the signal generation under any function or logic.
Each of the signals has its own scale however the scale is always within 0-10 .
On visualisation both the signals looks similar at times and dissimilar at times.

Question

How to find out if the red signal is moving in-sync with the black signal or is out of sync.
Note - The signals are realtime in nature , the look-back might be a maximum of 60 seconds.
What is the correct approach to solve problems like this?I am looking for some direction here.

Edit - Use case

These are two bacterial growths over time . Once both the bacteria population are in sync or async is detected then some action is needed to be taken. This action has to be taken only within 60 seconds of their new movement else the experiment leads to certain implications. It might happen that in a span of 1 hour there are 200 actions taken , quite possible , but the timing of the action and instant when both bacteria's change their trend has to be within 60 seconds.

For example

sync detected - 11:20:36 , trend started- 11:19:47 action - decrease control temperature
async detected -12:31:22 trend started- 12:30:24 action -increase temperature


texts:
for an internship I have to create a communication between 2 devices at 30Khz.
we choose a BPSK modulation.
I create du Tx with a stm32 and a DDS (AD9834).
Now I trying to code the demodulation with a L476 nucleo. and I have some issue.
now I have and acquisition of my signal using ADC (and DAC to see it).
But I don't know how to proceed next. I try to square it, but the result is not good.
If someone can help me ou have a tuto about stm32 and bpsk demodulation only with stm32 it will be very hepfull. thanks in advance


texts: Calculating the spectrogram of the center of pressure time series in human standing balance

texts:
I have some biomechanical data of a few subjects standing on a force plate. The center of pressure along the x and y axes was measured. The total time of measurement was 30s and the sampling frequency was 100Hz.

I want to observe if there is any reduction of the density P(t,ω) in higher frequencies as time passes.

I see that there are many time-frequency analysis methods and I was wondering which would be the best method to answer my question.

I have also another question. I inserted one signal after detrending the mean in the signal analyzer app in MATLAB but I am using it for the first time and it is like a black box for me. Which method does it use? Is it even suitable for my purpose?


texts:
I have a problem getting the final (simplified) version of the system's (in the figure below) output equation y[n]:

For this system, I know that $$w[n] = x[n] + aw[n − 1]$$ and $$y[n] = w[n] + bw[n − 1] = x[n] + aw[n − 1] + bw[n − 1] $$ however, the simplification method that yields this form: $$y[n] = x[n] + bx[n − 1] + ay[n − 1]$$ is not clear for me. Could anyone give me any tips/methods for deriving the final form of y[n]?


texts: GLP type three filter of order k, amplitude response?

texts:
Given a GLP type three filter of order K, with an amplitude response of |H(theta)|.

I need to show that the number of real and causal FIR filters(identically different) of order K, with the same amplitude response |H(theta)|, is less than or equal to $2^{k-2}$.

My thoughts:

I know that a GLP type three must have at least two zeros on its unit circle,
which means I have two filters which are identically the same.

meaning that's where the minus two comes from.

My Question is: how do I show such a thing mathematically?

how to think about it intuitively?

why is it two to the power..?

Thanks in advance,

Nadav


texts: FIR Filter - Low Pass Filter coefficients to High Pass filter coefficients

texts:
I need to convert this 12 Tap Low Pass Filter to a High Pass Filter.

The coefficients of the Low Pass Filter are as follows:

h[k] = [0.022 -0.083 -0.083 0.083 0.311 0.417 0.311 0.083 -0.083 -0.083 0.022 0.083]

My understanding is that if its an even-tap - We Multiply the coeffs by -1.

However the answer is:

hT[k] = [-0.022 -0.083 0.083 -0.083 -0.083 0.311 -0.417 0.311 -0.083 0.083 -0.083 -0.022 0.083]

I do not know how this came about. I looked for answers online alot but did not get the answer. Any help is appreciated


texts: Relation between Laplace and Fourier transforms

texts:
I know that  $$X_L(s=j\omega)=X_F(\omega)$$ if $x(t)$ is one sided and absolutely integrable and hence the imaginary axis of the Laplace transform is the Fourier transform.

But Fourier transform also has imaginary and real parts. So how could this be right?


texts: Does convolution done via the FFT _undo_ computational gains when signal has zeros every other sample?

texts:
Suppose we have filter $h[n]$, length $N$. If I use it to do convolution in the time domain, then there will be $N$ multiplications each time during the sliding. (Ignore border conditions for now). However if say $h[n]$ had zeros every other sample, then there would be half that number of multiplications, so ostensibly I save in computational load, since I have half the number of multiplies to do.

So then in conclusion the speed of convolution in the time domain is related to the number of zeros.

Now suppose I did this convolution via the multiplication in the frequency domain using the FFT instead. It seems that I would undo any gains I could have had, zeros or no zeros, because when we do it via the FFT method, it is agnostic to the actual values of the samples of the signal and filter.

Is this a correct assessment? If so, might there then be cases where a good old fashioned convolution in the time domain is in fact much faster than an FFT?


texts: How to apply audio superposition in mel spectrogram domain

texts:
Very rusty physicist here.
I have two audio spectrograms and I want to work out how to calculate the spectrogram of the superposition of the original waveforms (without having access to the original waveforms).
I'm pretty sure that's not doable because we don't have phase information, so we wouldn't know if the two sources are constructively or destructively interfering at any given frequency. But since the spectrograms are expressed in finite frequency buckets, is there a way to take some expectation value given a random phase?
And even forgetting my thought process there, generally is there some way in which what I'm asking for can be done?


texts: Analog to digital conversion using Python

texts:
I'm a beginner. I try emulate analog signal conversion to digital (including sampling by time and quantizing by level) using Python. Here is my code:

import numpy as np
import matplotlib.pyplot as plt

time_of_view        = 1.; # s.
analog_time         = np.linspace (0, time_of_view, 10e5); # s.

sampling_rate       = 20.; # Hz
sampling_period     = 1. / sampling_rate; # s
sample_number       = time_of_view / sampling_period;
sampling_time       = np.linspace (0, time_of_view, sample_number);

carrier_frequency   = 9.;
amplitude           = 1;
phase               = 0;

quantizing_bits     = 4;
quantizing_levels   = 2 ** quantizing_bits / 2;
quantizing_step     = 1. / quantizing_levels;

def analog_signal (time_point):
    return amplitude * np.cos (2 * np.pi * carrier_frequency * time_point + phase);
sampling_signal     = analog_signal (sampling_time);
quantizing_signal   = np.round (sampling_signal / quantizing_step) * quantizing_step;

fig = plt.figure ()
plt.plot (analog_time,   analog_signal (analog_time) );
#plt.stem (sampling_time, sampling_signal);
plt.stem (sampling_time, quantizing_signal, linefmt='r-', markerfmt='rs', basefmt='r-');
plt.title("Analog to digital signal conversion")
plt.xlabel("Time")
plt.ylabel("Amplitude")

plt.show()

In general I satisfied with it: if I play with variables the result is expected for me. Except one thing: according to the listing sampling_rate = 20 and carrier_frequency = 9 since sampling_rate / carrier_frequency > 2 I expect successful conversion but Instead I got distorted signal (look at picture: envelope of the output signal has clearly expressed amplitude modulation). Where is my mistake? Is my implementation correct?


texts: Should I observe a signal multiple times for MUSIC algorithm?

texts:
In a paper Multiple emitter location and signal parameter estimation, the well-known MUSIC algorithm starts by calculating covariance (autocorrelation, whatever) matrix with:

where overlines stand for expectation operation, i.e., $\overline{XX^H}\triangleq E\left[XX^H\right]$. As I understand, the MUSIC algorithm needs to observe signals multiple times to get $S$, i.e., $S=\frac{1}{N}\sum_{i}^{N}{X_{i}X_{i}^{H}}$
On the other hand, when I googled implementations of the MUSIC algorithm, most of them does not perform expectation operation. I mean, they just observe signals only one time and perform the remaining process of the algorithm, i.e., $S=XX^H$
Is there a reasonable explanation that the MUSIC algorithm does not need to observe signals multiple times, but only need to observe signals only once?


texts: Detection of a Pulse pattern with Matched filter

texts:
I am working on a hobby transmitter-receiver project. Presence of 4 pulses in T seconds is regarded as 1(not any number of pulses, should match below):

lack of pulses during that T seconds is regarded as bit 0. This is how transmitter block sends out information.
This signal is transmitted over a lossy channel so what I receive is r = alpha.s + noise , which is then digitized and passed to a DSP. Noise is not necessarily Gaussian (not sure of it's distribution).
1- Can I use matched filter(done in DSP) to detect if s was the Bit 1 shown above or Bit 0?
2- When should I sample the middle of match filter response? Does this need to be synched to start of every bit?
I am not sure what other method could be robust and reliable for decoding this.


texts: Purpose of eigenspace of covariance matrix of a blob?

texts:
Given a blob of an image (representing an object), according to Wikipedia, we can compute the co-variance matrix using the image moments.

I understand that the eigenvectors of that matrix can be used to represent the principal axes of an oriented bounding box (OBB), but what are the guarantees for that particular orientation? Is the OBB the one with minimal area? And, are the eigenvectors always orthogonal?


texts: Using reference objects to estimate the point spread function?

texts:
I have a well-defined object and a clear image matrix of it. In subsequent frames the object moves, causing motion blur. I want to use the object as a reference to "guide" the deconvolution and eliminate the motion blur.

My idea is to use a feedback loop: do object detection, find the object, then cross correlate with the original image to estimate the quality of my deconvolution. My concern is how to the evaluate the quality of the PSF so I can find the optimal estimate.

I am looking for a critique of my approach; does it make sense, and what are the pitfalls?


texts:
I have developed my own window function for pre-processing signals prior to a DFT (FFT). How do I measure the performance of the window so that I can specify how good (or bad) it is? Maybe other people would be interested in the window but only if I can quantify its performance I think.
If I can give an example... When I use a Blackman Harris window on a pure dc synthetic signal using a 48,000 sample DFT (with 1Hz resolution), the Blackman Harris window measures around 4dB below for the 1Hz bin. A Hanning window output is around 6dB down. My window gives a 1Hz bin value of around -170dB.


texts:
I am a beginner in digital communications and I have question for the data rate with CDMA. Let, the length of the spreading sequence is $L_c$, The modulation is BPSK and the symbol time is $T_s$.

To calculate the data rate, I make the following reasoning: I have $1$ bit for $1$ symbol. After, the spreading, the length is $L_c$.

Here my questions:

What is the duration of the spreading sequence?
On the internet, I found that the data rate for CDMA is $D=\frac{1}{L_cT_s}$. Why $L_cT_s$?
Many people calculate the data rate with the length of a frame, can you explain to me how to do that?


texts:
I understand the Fourier Transform which is a mathematical operation that lets you see the frequency content of a given signal. But now, in my comm. course, the professor introduced the Hilbert Transform.

I understand that it is somewhat linked to the frequency content given the fact that the Hilbert Transform is multiplying a FFT by $-j\operatorname{sign}(W(f))$ or convolving the time function with $1/\pi t$.

What is the meaning of the Hilbert transform? What information do we get by applying that transform to a given signal?


texts: How to compute total interference power at receiver antenna

texts:
I would like to know what is the proper way to sum interferences.
I have, for example, let say  0.4 mW, 0.035 mW and 0.2 mW are those interferences.
Do I have to sum them resulting 0.635 mW or make a conversion to log scale, for example, dBm and add these dBm log values?
The results are different; if I convert the three interferences 0.4 mW, 0.035 mW, and 0.2 mW to dBm and then sum them, it results in -25.52 dBm, which back to linear scale is 2.8$\mu$ W


texts: Is there a criterion that says at what point you can distinguish 2 partially overlapping Lorentzian peaks?

texts: If you have 2 Lorentzian peaks that partially overlap and you have some frequency resolution df (your points in frequency space are separated by df) and both Lorentzian peaks have FWHM $\Gamma$ is there a critereon that says how large a frequency separation you need between the centres of the 2 Lorentzian peaks to distinguish them as 2 seperate peaks?


texts:
In the SE Chemistry forum, someone posted an interesting question on converting a scaled and shifted delta function into Lorentzian by convolution please see "simulating a molecular spectrum". The OP was observing shifts on the x-axis after the convolution of his deltas' with a Lorentzian. This was obviously due to an incorrectly chosen center of the Lorentzian.
In convolution, the horizontal centroids add. So I suggested that a zero centered Lorentzian should be convoluted with the shifted delta and after that there will be no shift on the x-axis i.e., if the delta function is at x=t, after convoluting with a zero centered Lorentzian, there will be a Lorentzian at t - the desired location.
Another user suggested another alternative. His suggestion was that one can also center the Lorentzian at the mean of the x-axis values, $\mu$, and convolute this mean centered Lorentzian with the deltas. There will be no shifts, and indeed this was observed.
The query is:  Centroids add in convolution. It is understandable that when delta was shifted at x=t, and Lorentzian was centered at zero, so the resulting Lorentzian was centered at t+0=t.
Now, why is the other alternative working? This time the delta is at t, and the Lorentzian is centered at $\mu$, the resulting convolution should be at t+$\mu$, but still the deltas do not shift. What is the mathematical basis of getting the same results?
Here is a MATLAB code for a demo.
%Assigning variable names
x=[6200:2:6700-2]'; % x axis
Int=cat(1, zeros(80,1), 1, zeros(169,1)); %
Delta= x(2,1)-x(1,1); % Sampling interval

% Zero centered Lorentzian parameter;
N=[-(length(x/2)):Delta:length(x/2)-Delta]'; % x-axis for the zero centered Lorentzian
A= 1; %amplitude
W= 10; %full width at half maximum
M=0; %centered peak

L1= A./(1+4*((N-M).^2/W.^2)); % Lorentzian equation

% Mean centered Lorentzian parameters
mu=mean(x)
L2=A./(1+4*((x-mu).^2/W.^2)); % Lorentzian equation

F1=conv(Int, L1, 'same');
F2=conv(Int, L2, 'same');

figure (1)
subplot(1,3,1)
stem(x, Int,'.');
xlabel('time'); ylabel ('signal'); title ('shifted impulse')
subplot(1,3,2)
plot(N,L1)
xlabel('time'); ylabel ('signal'); title ('zero centered Lorentzian for convolution')
subplot (1,3,3)
plot(x,F1)
xlabel('time'); ylabel ('signal'); title ('impulse*zero centered Lorentzian')

figure(2)
subplot(1,3,1)
stem(x, Int,'.');
xlabel('time'); ylabel ('signal'); title ('shifted impulse')
subplot (1,3,2)
plot(x, L2)
xlabel('time'); ylabel ('signal'); title ('"mean time" centered Lorentzian for convolution')
subplot (1,3,3)
plot(x,F2)
xlabel('time'); ylabel ('signal'); title ('impulse*mean time centered Lorentzian')

Thanks.


texts: Windowing is a popular method of reducing the spectral sidelobes of OFDM. A popular window usually used for this purpose in the raised cosine (RC) window, because of its tapered and smooth edges. I understand the concept of windowing and why it reduces the sidelobes, however what I don't understand is this: "windowing a time domain OFDM signal is equivalent to every subcarrier being individually windowed by the window function (RC for example), basically the sinc sidelobes of every subcarrier will be reduced". This is true and you can actually see it when the window function is applied to a non-contiguous OFDM signal (some subcarriers are deactivated somewhere in the middle of the spectrum), the spectrum is not only reduced at the edges of the band, but also in the in-band. You can't get this if you apply a filter to the signal, with a filter you only see power spectrum reduction in the edges but not in the band. I'd appreciate if someone can explain why this is true, preferably with some equations.


texts:
I have simultaneously recorded data coming from three pre-amplifiers with same input applied to these pre-amps. After post analysis, i found that there are phase and gain differences among these outputs ( which should be zero in ideal case). I set one preamplifer output as reference and measure the phase and gain difference values of other two preamps with respect to this reference using "fft technique" for a typical frequency value.

Now question is how can i use these phase/gain difference values to align all three signals in software?

Note: Idea is to save these phase/gain coefficients permanently and multiply them with each corresponding preamplifier's outputs (excluding reference ) sample by sample for each acquisition so that inherent phase/gain difference b/w preamplifiers can be adjusted without modifying the electronics.

Thanks


texts: I have audio samples which MFCCs i want to train, but there is a problem. I can't find a classification model, because the samples have different length and consequently the MFCC matrices will also have different lengths. My question is - which machine learning model can i use?


texts: Errors when converting from digital filter object to transfer function

texts:
I am trying to use the designfilt tools in MATLAB to create a bandpass filter, but to be compatible with other code I need the resultant filter in transfer function coefficient form with B and A. To start with I took an example from the filter design gallery, and just changed the sampling rate to match that of my real data.

Fstop1 = 150;
Fpass1 = 200;
Fpass2 = 300;
Fstop2 = 350;
Astop1 = 65;
Apass  = 0.5;
Astop2 = 65;
Fs=16384;
% Fs=1000;

d = designfilt('bandpassiir', ...
  'StopbandFrequency1',Fstop1,'PassbandFrequency1', Fpass1, ...
  'PassbandFrequency2',Fpass2,'StopbandFrequency2', Fstop2, ...
  'StopbandAttenuation1',Astop1,'PassbandRipple', Apass, ...
  'StopbandAttenuation2',Astop2, ...
  'DesignMethod','butter','SampleRate', Fs);

This filter seems to be behaving itself, isstable returns 1 and the $z$-plane seems acceptable:

However, when I try to get the coefficients using [B,A]=d.tf; the resultant filter is no longer stable and the $z$-plane looks totally different:

The values for B are incredibly small around e-26, so I am imaging that it might be to do with gains of the coefficients? If I set Fs back to the original $1\textrm{kHz}$, this two $z$-planes plots are the same.

Can someone help me with sorting this problem? Is the fact that the transfer function form is unstable speak to the stability of the filter when it is in the digitalfilter object form?

edit

The documentation for the butter function even describes these errors here


texts:
If a carrier ($f_c$) is FM modulated by a single sine wave ($f_m$), its spectrum is composed of frequencies at $f_c + kf_m$ ($k \in \mathbb{Z}$) whose amplitudes are weighted by $J_n(\beta)$, the $k$-order Bessel function of modulation index $\beta$. We could get such spectra :

Now, what would be the spectrum of the carrier if it was modulated by a more complex signal like speech or music ?
Short term Fourier transform of the modulating signal would be :

Harmonic (e.g. : vowel in speech, or a violin note)
Non harmonic (e.g. : some consonants in speech, some percussive instrument)

In both case, modulating signal will have a more richer frequency content than a single sinusoid.
Will these rich spectra just repeat regularly around $f_c$ as in the case of a single tone modulating signal ? Why ? What would happen in the simple example of a 2 tones modulating signal ?
If a carrier is AM modulated by complex signal like speech, we find the spectrum of modulating signal shifted around the carrier (as seen in the spectrogram below) : what would happen with FM modulation for such rich signals ?


texts: What is Earth Movers Distance and how is it used in pattern recognition?

texts: I have obtained this from Wikipedia about the application of Earth Movers Distance to pattern recognition. Can anybody explain the concept of signature used in this Wikipedia article. Thanks.


texts:
I'm working on a problem where I'm trying to use background averaging to see what the frame looks like in a beehive behind the bees. I've been trying to use standard averaging (I take an image every 1 or 4 seconds over the course of my 3 hour video) as well as other techniques like mog and mog2. The problem is that there is an extremely high density of bees in the centre that is tightly packed and barely moving, so while I end up with a great view of the background around the middle, the centre turns into a bit of a smear like this:

Does anyone have any advice on what I could do to improve things? I spoke to a researcher who suggested something called "sparse coding" as one possible options and I'm curious if OpenCV has anything like that or if anyone knows of any other techniques I could try.


texts: Confusion in Channel Encoding and Convolutional Encoding

texts:
If I'm making NRZ signal by first encoding 1 input bit into 10 bits multiplied by -V/+V before sending it into a channel, is it called channel encoding?
If I then modulated it using GMSK technique, can it be considered Convolutional Encoding?


texts: How to calculate Walsh hadamard transform for image patches of odd sizes?

texts:
I was reading this paper on optical flow, which as apart of the algorithm makes use Walsh-Hadamard transform on image patches of size 2r+1. So far, where ever I have looked, I could only find that WHTs require matrices of orders of powers of 2. In a footnote, they have mentioned splitting the patches in the middle for this purpose into sizes of r and r+1 which is something that I don't understand.

here, is a link to that paper: https://arxiv.org/pdf/1703.02563.pdf


texts: Why FFT does not retrieve original amplitude when increasing signal length

texts:
I don't understand why FFT return different maximum amplitude as the signal length increase. I would except that with a large signal length according to the frequency, detected amplitude will be very accurate.

From where this periodic signal is coming ?

Here is the related python code I used to generate the plot:

%matplotlib qt
%load_ext autoreload
%autoreload 2

import numpy as np
import matplotlib.pyplot as plt

def get_fft(x, dt):
    n = len(x)
    fft_output = np.fft.rfft(x)
    rfreqs = np.fft.rfftfreq(n, d=dt)
    fft_mag = [np.sqrt(i.real ** 2 + i.imag ** 2) / n for i in fft_output]
    return np.array(fft_mag), np.array(rfreqs)

def build_signal(amp, freq, signal_len):

    f = freq
    A = amp
    dt = 1
    t = signal_len

    x = np.arange(0, t, dt)
    y = A * np.cos(2*np.pi*f*x)

    fft_mag, rfreqs = get_fft(y, dt)
    return x, y, fft_mag, rfreqs, amp, freq, signal_len

# Build sin wave from 1 to 5000 signal length with freq=1e-3Hz and amplitude=0.5
all_t = []
all_amp = []
for t in np.arange(1, 5000, 100):
    x, y, fft_mag, rfreqs, amp, freq, signal_len = build_signal(amp=0.5, freq=0.001, signal_len=t)

    all_t.append(t)
    all_amp.append(fft_mag.max())

# Plot amplitude from FFT against signal length
plt.figure()
plt.plot(all_t, all_amp, 'o-')
plt.xlabel("Signal length")
plt.ylabel("Amplitude from FFT (0.25 is excepted)")

As MackTuesday ask in comment, I plotted the signal and related FFT for signal length = 1000 and 1400.


texts: Sample Frequency - Recommended Practical Nyquist, Lower Used by majorities appications

texts:
Doubt1: What is the Lowest Sampling Frequency used by majorities sound applications. Is there limited frequency sampling lower than 8KHz In C/C++?

Comment In Java I haven't detected any problem, but using VCL program into one wav sound file (with lower Freq to 8K) was not played, producing Error!

Doubt2: Can I to capture sound using arbitrary Frequency Sampling in C/C++? This process/function/method depends on specific Library? Can I to do this using pure C/C++ Code (without specialized Libraries), where?

Maybe this is a foolish question. I have sound with the 100Hz-500Hz Spectrum.

Doubt3: What is the recommended lowest Nyquist Sampling Frequency (I Know that teorical is two), but is there another practical Criterion? Example: Is recommended to use 2.5, 3 or 4.
In my sound the TEORICAL Nyquist sampling Frequency must be 1KHz.

Thank you


texts: Implement a software PID for the first time in real time software, I can find P what about I and D?

texts:
Here we have the basic formula of a Proportional Integral Derivative controller. This is the formula from the Wikipedia page on the subject

I want to implement this type of controller in my system. Currently the system (function in the software) is fed a psi value and told to set an analog output to a value so that this pressure is achieved. The function, lets call it SetPressure(int psi), has access to a table of psi vs analog signal output, it does quick binary search and finds the closest match and sets the analog output to that match.

This is not good enough for when the machinery/valves "wears in".

So now I have access to a pressure transducer to tell me the actual pressure in the line I am trying to control. It gives me an analog input to my function. I would like to figure out, given these values of commanded and actual values, how to create a software PID.

So, the first value is easy; P. This is found by determining the error in the value error = DesiredValue - ActualValue and multiplying it by some proportional gain Kp. So P = Kp*error this is easy enough to understand. After some tuning I should find a suitable value of Kp such that I can control the pressure a little better.

But what about if I would like to find the I and D?

The software this PID runs in is real time. It gets called every few milliseconds and reads the inputs and determines the outputs based on its state.

I guess for a start, where do I go from here to get I and D. I understand that there are gains for each of these terms but I am not sure about how I calculate the entire term.

For instance,  Do I need to save each calculated error for each time t so that I might find the integral? This seems it would be a waste of memory, saving each error for each moment in time would accumulate to a huge list in a matter of seconds.

Any help is appreciated. Please ask for clarification if needed, and note this is my first time working with something like this.

.

Code Sample so far:

(anaOutput[PRESS_OUT_DAC]  is already determined above in the code from the analog vs psi table)

float KpPressure = 1; // These gains are to be determined
float KiPressure = 1;
float KdPressure = 1;
float MVout = anaOutput[PRESS_OUT_DAC]; // Init to output

if(anaInput[PRESS_IN_DAC] != anaOutput[PRESS_OUT_DAC])
{
    // error = SetPoint - ProcessValue
   float error = (float)anaOutput[PRESS_OUT_DAC] - (float)anaInput[PRESS_IN_DAC];

   // Pout = Kp * error
   float Pout = KpPRessure * error;
   // Iout = Ki * Int(0,t)[error(t)]
   float Iout = KiPressure * 1;              //// What should 1 be?
   // Dout = Kd * (d/dt)[error(t)]
   float Dout = KdPressure * 1;              //// What should 1 be?

   // Manipulated Output = Combination of PID
   MVout = P + I + D;
}
if(MVout > MAX_SIGNAL)
      MVout = MAX_SIGNAL;

 anaOutput[PRESS_OUT_DAC] = (UWORD)MVout + ANALOG_ZERO;


texts:
The 16-point DFT of a real signal x[n] in the domain 0 ≤ k ≤ 8 is given by
$$X[k] = 1 + (1 − 3j)\delta[k − 2] + (5 + 2j)\delta[k − 4] + (3 − 7j)\delta[k − 6] + \delta[k − 8]$$.
(a) Determine $X[k]$ for $9 \le k \le 15$.
(b) Determine the related signal $x[n]$.


texts: How to add a frequency offset to a buffer of MPSK signal for simulation purposes?

texts: I need to simulate some channel effect to a buffer of MPSK signal. How to add a frequency offset to a buffer of baseband MPSK signal?


texts: Is $ H\left\{x_h(t)\right\} = H\left\{x\left(t-\frac{\pi}{2w_c}\right)\right\} $ where $H$ is Hilbert transform

texts:
Accordind to my understanding of the following:

$$H\left\{X(f)\right\} = -j\;sgn(f)\; X(f)  \qquad(1)$$

my work so far:

since $ x_h(t) = x\left(t-\frac{\pi}{2w_c}\right)$, Their Hilbert transforms are equal in time and frequency domains.Hence,

$$ H\left\{x_h(t)\right\} = H\left\{x\left(t-\frac{\pi}{2w_c}\right)\right\}, \:\text{where $H$ is Hilbert transform.
} $$

Let  $ \: y(t) = x\left(t-\frac{\pi}{2w_c}\right)\ \: $.We have

$$ H\left\{x_h(t)\right\} = H\left\{y(t)\right\} .$$ Therefore,

$$H\left\{X_h(f)\right\} = H\left\{Y(f)\right\} \\ \\ $$

L.H.S

by applying what is stated in the picure, we have:
$$H\left\{X_h(f)\right\} = -j\;sgn(f)\;  X_h(f)   = -j\;sgn(f)\;  \left[-j \; X(f) \; sgn(f)\right] $$

after simplification:
$$\text {L.H.S} = -X(f)$$

R.H.S
$$H\left\{Y(f)\right\} = -j\;sgn(f)\; Y(f) = -j\;sgn(f)\; \left[X(f) \; e^{-j2\pi \left(\frac{f}{4f_c}\right)} \right ] = \text {R.H.S} $$  by simplifying $$ \frac{\pi}{2w_c} = \frac{\pi}{2\left[2\pi f_c\right]}  = \frac{1}{4fc} $$ and by the shifting property:

$$F \left\{x(t-t_0)\right\} = X(f) \; e^{-j 2\pi f t_0}  \\ \\ $$

$$ - X(f) \quad \ne  \quad -j\;sgn(f)\; \left[X(f) \; e^{-j2\pi \left(\frac{f}{4f_c}\right)} \right ] $$

Thank you in advance.


texts: Phase is not linear in frequency domain after delay in time domain

texts:
When impulse response is symmetric around sample zero phase entirely zero.

in = 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 -> This gives zero phase result

As I know if I apply a delay in time domain this should result a linear phase in frequency domain. So if I delay my previous vector by one;

in = 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 -> This should give linear phase responce

const int N = 11;

// in = 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0
std::vector< std::complex<double> > in (N);
std::vector< std::complex<double> > out (N);
std::vector< std::complex<double> > polarOut (N);

auto middleElem = in.begin() + in.size()/2;
//std::fill( middleElem - 1, middleElem + 3, 1); //zero phase
std::fill( middleElem, middleElem + 4, 1);

fftw_plan my_plan  = fftw_plan_dft_1d(N, reinterpret_cast<fftw_complex*>(&in[0]),
                                         reinterpret_cast<fftw_complex*>(&out[0]), FFTW_FORWARD, FFTW_ESTIMATE);
fftw_execute(my_plan);

std::transform( out.begin(), out.end(), polarOut.begin(),
                []( auto& in ){
                                return  std::complex<double>( std::abs(in), std::arg(in) );
                              } );

The result of the fourier transform in polar notation is :

    polarOut    <11 items>  std::vector<std::complex<double>>
        [0] (4.000000, 0.000000)    std::complex<double>
        [1] (3.228707, 2.570394)    std::complex<double>
        [2] (1.397877, -1.142397)   std::complex<double>
        [3] (0.372786, -1.713596)   std::complex<double>
        [4] (1.088156, 0.856798)    std::complex<double>
        [5] (0.546200, -2.855993)   std::complex<double>
        [6] (0.546200, 2.855993)    std::complex<double>
        [7] (1.088156, -0.856798)   std::complex<double>
        [8] (0.372786, 1.713596)    std::complex<double>
        [9] (1.397877, 1.142397)    std::complex<double>
        [10]    (3.228707, -2.570394)   std::complex<double>

What am I missing here? Why phase responce is not linearly increasing?