texts:
My project consists in filtering an audio signal from the microphone, in order to remove noise, and find the time distance between two peeks with the highest precision possible.

I understood that an FIR filter as a linear phase response since the coefficients are symmetric or anti-symmetric, thus there will be a constant delay; so this will let me know exactly the distance between two peeks. Am I right?

Since I'm using an Android device as DSP, I'm trying to reduce as possible the filter coefficients number. Here's my question: can I use a IIR filter for this project or the original wave form will be delayed with a non linear phase, giving wrong results?

TL;TR; Can I use a IIR filter to filter an audio signal in order to calculate the real time distance between two peeks?


texts: What is the need of IIR filter? When FIR have generally good/desirable characteristics?

texts:
FIR filters are generally stable and have linear phase response. These two characteristics are often desired in dsp

So why do we need and use IIR filters,despite the fact that IIR filters often have issues in these two characteristics of stability and linear phase response ?


texts: What are the Segmentation algorithms that can be used to process Satellite images (obtained from Google Earth) to segment forest and barren areas?

texts: I have tried Region based Segmentation - through Seed Growing, Watershed algorithm, and Graphcut algorithm, but none have been successful so far. I am using MATLAB.


texts: Bilinear Interpolation on A Subsection Of An Image

texts: Is it possible to do bilinear interpolation on each 8 by 8 block of an image one at a time until you cover the entire image rather than doing it on the entire image? What are the consequences of this?


texts: finding FL and FH from continuous time signal

texts:
I have a continuous signal $x_{a}$ which is defined as $X_{a}(F)=0$ for $|F|>B$.
Now if I multiplied the continuous signal $x_{a}$ by $cos6\pi Bt$. Then the fourier transform of the signal can be defined as the following:

$$
Y(F)= \int_{-\infty}^{\infty}{x_{a}(t)\ cos6\pi Bt\  e^{j2\pi Ft}}
$$
$$
\qquad \qquad \qquad \qquad \qquad \qquad \  =\frac{1}{2} \int_{-\infty}^{\infty}{x_{a}(t)\  e^{j2\pi(F + 3B)t}} + \frac{1}{2} \int_{-\infty}^{\infty}{x_{a}(t)\  e^{j2\pi(F - 3B)t}}
$$
$$
\qquad \qquad \qquad=\frac{1}{2}\ X_{a}(F+3B) + \frac{1}{2}\ X_{a}(F-3B)
$$

From that equation how do I find the $F_{H}$ and $F_{L}$ of my new continous time signal. This problem is taken from problems 6.1 in Digital Signal Processing 4th Edition by Proakis & Manolakis. Thank you for helping me out.


texts:
Please can someone verify these basic results about error correcting codes.

For this example I am using Reed-Solomon because there are functions to calculate the rate $r$ and distance $d$ of the code, which are

$$r = \frac{k}{n}$$
$$d = n - k + 1.$$

1.0 The rate and distance are independent for this code.

1.1 By introducing the parameter $c$, the rate can be changed without affecting the distance

$$r = \frac{k+c}{n+c}$$
$$d = n + c - k - c + 1 = n - k + 1.$$

1.2 The distance can be changed without affecting the rate

$$r = \frac{ck}{cn} = \frac{k}{n}$$
$$d = c(n - k) + 1.$$

I understand that there is nothing in these equations that prevents me from setting the rate higher than the channel capacity, but the proof of Shannon's noisy coding theorem is very complicated for me.

Am I on the right track with these ideas? Can you recommend any references to help me understand the capacity constraint?


texts:
Can someone explain me the highlighted text parts regarding this image ?

Here is a pseudo-code of how it was created:

kSobelX = zeros(100);
kSobelX(1:3,1:3) = [1,0,-1;2,0,-2;1,0,-1];
kSobelXfft = fft2(kSobelX);
clf; scale equal;
image(abs(kSobelXfft)/max(abs(kSobelXfft(:))));
print;

Pixels on the left of the square correspond to low frequencies along the x axis. Because the discrete Fourier transform is discrete in space, it's periodic in frequency: pixels on the right of the square correspond to low negative frequencies along the x axis. And because the spatial data is real, the frequency data is symmetric. The middle of the square correspond to the Nyquist frequency (half the sampling frequency). The regions at 1/4 and 3/4 positions correspond to the highest frequencies the filter operates at. Along the x axis, the light region means the Sobel filter is a highpass filter; along the y axis, the light regions are at low frequencies, i.e. the Sobel filter is a low-pass filter.


texts:
I'm new with signal processing and have started to learn it for physics research I am involved in. I have a signal which I want to process to find the amplitude of one frequency of. To do this, I'm multiplying the signal numerically by sin(2πft) and cos(2πft), so Y = signal * sin(2πft), X = signal * cos(2πft).  then taking the square root of the sum of these squared for the amplitude and arctan of Y/X for the phase over time. What does the plot of arctan(Y/X) actually show me? For an example, I have a code in Python I'm using for testing this.

from matplotlib.pyplot import *
from numpy import *
from scipy.signal import butter, lfilter

def butter_lowpass_filter(data, cutoff, fs, order=5):
    '''Creates a lowpass filter for the data'''
    nyq = 0.5 * fs
    normal_cutoff = cutoff / nyq
    b, a = butter(order, normal_cutoff, btype='low', analog=False) #filters data
    y = lfilter(b, a, data) #filters data
    return y

def sin_stat(time, f0, method = 'sin'):
    '''Creates sine and cosine data to be used for manipulating data'''
    if method == 'sin':
        return [2.0 * np.sin(2*pi*f0 * t) for t in time] #2 in front to cancel out 1/2 later
    if method == 'cos':
        return [2.0 * np.cos(2*pi*f0 * t) for t in time]

def stats(time, signal,f0,sample_freq, cutoff = 1): #cutoff is in hz
    ''' first creates list of sine and cosine data to numerically multiply all
    data by. Then Makes X, Y, which are data times cosine data and sine data
    respectively. '''
    C = sin_stat(time, f0, method = 'cos')
    S = sin_stat(time, f0, method = 'sin')

    X = [d * c for d,c in zip(signal,C)]
    Y = [d * s for d,s in zip(signal,S)]

    X_low = butter_lowpass_filter(X, cutoff, sample_freq) #lowpass each
    Y_low = butter_lowpass_filter(Y, cutoff, sample_freq)

    amp = [np.sqrt(x**2 + y**2) for x,y in zip(X_low, Y_low)]
    phase = [np.arctan(y/x) for y,x in zip(Y_low,X_low)]

    phase = [2 * (x + np.pi/2) for x in phase]
    phase = np.unwrap(phase)
    phase = [x/2.0 for x in phase]
    return (amp,phase)

sample_freq = 100 #hz
end = 1000
t = linspace(0,end,end*sample_freq)
s = 5*sin(2*pi*10*t + 2) + 2*sin(2*pi*7*t + 1) + sin(2*pi*4*t +.5) + .2*sin(2*pi*2.3*t+.7)
plot(t,s)
show()
close()
amp, phase = stats(t,s,2.3,sample_freq,.5)
plot(t,amp)
show()
close()
plot(t,phase)
show()
close()

The amplitude plot shows the amplitude converge to the amplitude I define in the signal, but the phase plot does not. If my guess for the frequency in my In-phase and Quadrature signals is the same as in the simulated signal with a low-pass cutoff of .5 hz, I receive this:

However, if I change the guess frequency to something not exactly the frequency, say 2.4 Hz, I receive this:

Could someone explain what I am actually seeing? What does the slope of this represent? In my real data, I always have a slope of some sort due to not knowing the exact frequency of what I am looking for, only an approximation. I would like to calculate frequency vs time to perform an allan deviation plot, but am unsure of how to calculate frequency from this. I feel I am on the right track, but am a little confused. I've been using this for understanding a little of what I'm doing: http://www.thinksrs.com/downloads/PDFs/ApplicationNotes/AboutLIAs.pdf


texts: Amplitude/phase recovery on noisy signal

texts:
I have a noisy signal that has an ac component of fixed frequency but variable amplitude and phase. I'd like to recover the ac component.

The signal (blue trace) is mostly smooth, but has a few larger discontinuities.

The phase and amplitude of the ac component vary with time,
this is how the signal looks like (green). Noise not shown:

The sampling rate is not commensurate with the ac period, this causes the aliasing seen in the picture. Unfortunately I cannot change this.

From this data, I need to recover amplitude and phase of the ac component, if possible also the harmonics.

My current approach is to multiply the data with a sine and cosine and then use a LPF to recover the quadrature components. I am not too happy with that approach, as the aliasing requires a very low cutoff frequency that smears out sharp transitions in the phase.

Also, I'd like to explore the solution space with some global constraints on amplitude and phase, e.g. sparsity and piece-wise continuity of the phase.

What is the right approach for phase and amplitude recovery? Can this be treated as a constraint convex optimization problem, or are there better solutions?

Update:

I have taken some real measurement data. I didn't have any data with the ac signal, so I have added an ac component numerically. The ac peak due to the signal is the highest green peak close to DC. The other two blue peaks are due to a digitizer artifact. The green curve is pretty much the same as the blue one in front elsewhere.
This curve did not have any modulation on the ac signal, for a real signal, the peak would be about 2/3 that high and have some sidebands. This is shown in the inset image, the red curve is for the amplitude and phase modulated signal.

# simulated raw data for first plot
d=[0] * 50 + [1]*50 + list(np.linspace(0.5,1,50)) + list(np.exp(np.linspace(0,-1,30)))
# with additional small signal ac overimposed. Normally amplitude and phase would change as well
ds=d + 0.1*np.sin(100*np.linspace(0,6,180))
plt.plot(ds)

This is what I meant with global constraints: The data is very noisy, and it is not realistic to measure amplitude and phase without any averaging. On the other hand, I have some hypotheses about amplitude and phase, and would like to make use of them for filtering the data. For example, I know that there are sharp transitions in the phase, with areas of constant phase in-between. I don't want to average out the transitions. So ideally, I would like to recover the instantaneous amplitude and phase of the ac signal and then use a LASSO-like method to filter.


texts:
I want to remove the DC from a ADC, so I designed a two-pole, 1 Hz high-pass Butterworth filter for a signal sampled at 10kHz. The filter coefficients are:

a =  [ 0.99955581 -1.99911162  0.99955581] (a0, a1, a2)
b =  [ 0.          1.99911142 -0.99911182] (don't use, b1, b2)

Once the filter gets going (after 1 second) it work great, but it has a wicked response in that first second. I tried initializing the first two y's with both 0's and the future 1 second average. Testing the filter with white noise, here is an example of the initial transient. The initial variance of the white noise is 1 and the transient wanders up to 370 before settling down!

Question: What, if anything, can I do to calm this down?

BTW, my one-pole filter doesn't do this! Is it a stability issue with the two pole filter with a large ratio of sample frequency to cutoff frequency?


texts:
I am trying to use gnu radio to transmit data from one SDR to another using a 16QAM modulation scheme. This is the diagram on the receiver side.

Looking at the constellation sink, the constellation will not resolve. Every once in a while, it briefly looks like it comes close to the standard 16QAM constellation but falls apart. I do not think that multipath is the culprit here. The antennas are very close to one another. I expect it to be some sort of timing issue.

I am confused about the parameters in the Constellation Receiver block. What is the "loop bandwidth" parameter? What does it change and what is the most common range of values used for it?

I am also confused about the maximum and minimum frequency deviation parameters. A general description of what these change would be helpful. The documentation says these values are the maximum and minimum "normalized" frequency values. What are the frequency values normalized to? Does maximum frequency deviation mean the maximum allowed mismatch between the transmitter and receiver local oscillators?


texts: express pass band filter as sum of low pass filter

texts:
I have to find impulsive response of an ideal pass band filter, but I have a problem to express $$ H_{BP} (f) $$ as a sum of $$ H_{LP} (f) $$. I mean that $$ H_{BP} (f) = rect ( \frac{f-f_0}{B} ) + rect ( \frac{f+f_0}{B} ) $$ but $$ H_{LP }= rect (\frac{(f- f_0)}{2B} ) $$ so I wrote $$ H_{BP} (f) = rect ( \frac{2(f-f_0)}{2B} ) + rect ( \frac{2(f+f_0)}{2B} ) $$. Now probably it’s wrong but I wrote $$ H_{BP} (f) = 2 H_{LP} (f-f_0) + 2 H_{LP} (f+f_0)$$
Now I should apply wave demodulation $$ h_{BP}(t)= \frac{1}{2} h_{LP} + \frac{1}{2} h_{LP} cos(2 \pi 2 f_0 t) $$. I hope i wrote at least one right thing


texts: Isolating frequency-specific oscillation from transient

texts:
I am performing time-frequency analysis on electrophysiological data with complex morlet wavelets. Each decomposition in the attached figure shows total power following the onset of a stimulus (top row) or preceding an eye movement (bottom row). There is a broadband, transient increase in power following stimulus onset.

I am interested in determining whether there are frequency-specific changes in power (i.e., 'oscillations') during the 0-200 ms epoch as well; therefore, I have parsed the total power into phase-locked and non-phase locked components. Because variability in response latencies may bleed into the estimate of non-phase locked power (David et al. 2006),

I want to compute adjusted power as recommended by these authors (pg 1589). I am unsure of how to implement this orthogonalization in Matlab-- it is slightly beyond my mathematical savvy.

I attached a snapshot of the related paragraph in the paper as well.

Is anybody familiar with this computation?


texts: correct for shift from butterworth filter?

texts:
I have implemented a python butterworth filter but it seems to shift the data a lot, the x location of my data is very important to me for my analysis. Is there a way to correct for this shift precisely?

Does it shift all the data uniformly? Or does certain areas get shifted further/less far that others?


texts: How to build a simple model for voice-controlled system?

texts:
I want to build a speaker independent voice-controlled system. If I ask 10 people to say one unique word(for example"hello"), and record their voice and do LPC(linear predicting coding) upon them, I have 10 arrays of LPC coefficients, right?
So how should I combine these 10 arrays to build one array(my model of "hello word" and use it to compare with my system's new input voices? (I like to use DTW algorithm for this comparation).

Thanks!


texts:
Disclaimer: I’m computer scientist, no math expert
I’m computing a frequency spectrum by applying an FFT on 10000 real numbers acquired at 10kHz.
The FFT produce 10000 complex numbers. The frequency spectrum is obtained by computing the magnitude of the complex numbers and yields a symmetric array. I’m programming in Go if it matters.
I was expecting that the magnitude of 0Hz would be stored at index 5000, and 1kHz at index 6000 and 4000. But magnitude of 0Hz is stored at index 0, and 1kHz at index 1000 and 9000.
Is this normal, or is this a feature of the library I use ?


texts: How to obtain the Sound Pressure Level from .wav file based on these given parameters?

texts:
I have a wav file recorded from a hydrophone. I am not quite familiar with signal processing so I really need some advice from you.

I have gathered the information which looks useful and related.

sample rate = 250 000 Hz

Receive sensitivity of hydrophone = -180 db re 1V/μ Pa

Peak-to-peak voltage range = 5.64 V

Pre-amplifier gain = 18 dB (Modified)

Let A be the amplitude saved in the wav file. What is the formula to transform A from amplitude to Sound Pressure Level?

If the given information is not sufficient, please tell me what more do I need?

Any helps are appreciated!


texts: Why do we need to flip the kernel in 2D convolution?

texts:
Why do we need to flip the kernel in 2D convolution in the first place?
What's the benefit of this?
So, why can't we leave it unflipped? What kind of terrible thing can happen if you don't flip it?

SEE:
"First, flip the kernel, which is the shaded box, in both horizontal and vertical direction"

http://www.songho.ca/dsp/convolution/convolution2d_example.html


texts: How to perform a Stockwell Transform on a 2D matrix

texts:
I was looking at performing a Stockwell transform on a matrix (or an image as it has two directions - the matrix I am interested in has a spatial dimension and a time dimension, but this should make no difference) instead of an array. Whilst there are a couple of codes that perform a Stockwell transform on an array (see infomation about Stockwell Transform for links to 2 of them and http://www.mathworks.com/matlabcentral/fileexchange/45848-stockwell-transform--s-transform- for one without for loops), I could not find one for a matrix/image.

According to Mansinha et al. (1997), for a matrix $h(x,y)$ the S-transform can be defined as

$ S(x,y,k_x,k_y) = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} H(\alpha + k_x, \beta + k_y) e^{-\frac{2\pi ^2 \alpha^2}{k_x^2}} e^{-\frac{2\pi ^2 \beta^2}{k_y^2}} e^{i2\pi (\alpha x + \beta y)} \mathrm{d}\alpha \mathrm{d}\beta$

for $k_x \neq 0 $ and $k_y \neq 0 $; where $H(k_x,k_y)$ is the 2D Fourier transform of the matrix $h(x,y)$. $x$ and $y$ are spatial variables and $k_x$ and $k_y$ are the corresponding wavenumbers.

The discrete form of the above according to the same paper is given by

$ S(pT_x, qT_y, \frac{n}{NT_x}, \frac{m}{MT_y}) = \sum\limits_{n'=0}^{N-1}\sum\limits_{m'=0}^{M-1} H(\frac{n'+n}{NT_x},\frac{m'+m}{MT_y}) e^{-\frac{2\pi^2 n'^2}{n^2}} e^{-\frac{2\pi^2 m'^2}{m^2}} e^{\frac{i2\pi n'p}{N}} e^{\frac{i2\pi m'q}{M}}$

for $n \neq 0$, $m \neq 0$; where $H$ is the 2D Fourier transform of the matrix $h(pT_x,qT_y)$ and $p=0...,N-1$, $q=0...,M-1$ and $T_x,T_y$ are the sampling intervals in the respective directions.

Therefore (if I understand it correctly) the above process is a inverse Fourier transform to a multiplication in the frequency domain.

Unfortunately, I was unable to code up because the 2D Fourier transform of $h(pT_x,qT_y)$ has the same dimensions as $h$ and thusthere is a mismatch with $H(\frac{n'+n}{NT_x},\frac{m'+m}{MT_y})$.

Any help in coding the above in MATLAB is greatly appreciated. This (http://www.mathworks.com/matlabcentral/fileexchange/45848-stockwell-transform--s-transform-) is a very efficient 1D transform which has helped me understand how it works. The link for the paper is http://www.sciencedirect.com/science/article/pii/S0031920197000472 (if you have access to it)


texts: Phase vocoder, pitch shift in MATLAB and C

texts:
I'm trying  to make a Phase Vocoder in MATLAB. But I'm stuck with the calculations on changing the pitch. I browsed loads of website and I simply do not understand what to do.

Currently I have in my MATLAB code a working flow where input = output

$${\xrightarrow{\rm Input}}\boxed{\text{sampling}}{\rightarrow}\boxed{\text{Hanning window}}{\rightarrow}\boxed{\text{STFT}}{\rightarrow} \cdots {\rightarrow}\boxed{\text{ISTFT}}{\rightarrow}\boxed{\text{Add}}{\xrightarrow{\rm Output}}$$

What do I have to do in the $"\cdots"$ to get the pitch shift?
With the STFT I get the FFT of 1024 sample windows with 512 overlap.


texts: What does 'z' in Z-transform represent ? Is it frequency or something else?

texts:
my question is about the Z- transform. My first question is what the title says. What does 'Z' in Z-transform represent ? Say in Fourier transform, 'w' (omega) represents frequency ? From Fourier transform, I can know what is the strength of the signal at a certain frequency component, right? Then what idea do I get from Z-transform ?

And, in Fourier transform, we can draw a graph with x-axis as the frequency and y-axis as the amplitude of a certain frequency component. Can we do the same for Z-transform, with x-axis as the different 'Z' values and y axis as the Z-transform for a particular Z ?  My textbook says only about equations, but I don't get the significance of 'Z' in  Z-transform. And about the graph thing, I haven't encountered any such graph in any textbook, only the Z-plane.


texts: I always read the word "phase" (like linear phase, phase shift...) in DSP but I'm still not sure what it supposes to mean, in intuition and also in practice.


texts: Kalman filter restricted by areal constraints

texts:
I'm developing a device for tracking pets in a room with several motion detectors. I use a Kalman filter to estimate the position, which is based on the active outputs of the motion detectors. If an motion detector is active the center of the detection region is the measurement value (position). In some cases the filter estimates the position to be outside the room.

How can I restrict the Kalman filter, should I restart and reinitialise the filter when the estimated position is not in the predefined area (of the room)?


texts:
I have an image in which I am trying to find the statistics of the offsets for 8 x 8 patches that are taken by sliding them pixel wise.

To be more clear, what I do is I take a patch and try finding the most similar one in the same image by taking the Euclidean distance of the pixel values and keeping the index of the minimum value. I know how to do this, but what struggles me is that, to keep reliable statistics, I must preclude nearby patches, where I intend to take the distance of preclusion as 8 pixels.

Achieving this in MATLAB with decent vectorization causes algorithmic problems. I use im2col to vectorize all the patches with sliding property, and then I take the first patch, repmat it to the same size, and take the euclidean distance between them and get the min of it. I repeat the process for all other patches in a for loop and keep the statistics.

Any suggestions on implementing the preclusion of the nearby patches are appreciated.


texts: Flat top sampling to a step shape signal

texts:
Flat Top Sampling
During transmission, noise is introduced at top of the transmission pulse which can be easily removed if the pulse is in the form of flat top. Here, the top of the samples are flat i.e. they have constant amplitude. Hence, it is called as flat top sampling or practical sampling. Flat top sampling makes use of sample and hold circuit.

Theoretically, the sampled signal can be obtained by convolution of rectangular pulse $p(t)$ with ideally sampled signal say $y_\delta(t)$, i.e.
$$y(t)=p(t)\star y_\delta(t)\tag{1}$$
To get the sampled spectrum, consider Fourier transform on both sides for equation $(1)$
$$Y\left[\omega\right]=\mathcal F\left\{p(t)\star y_\delta(t)\right\}$$
By the knowledge of convolution property,
$$Y\left[\omega\right]=P(\omega)Y_\delta(\omega)$$
Here $P(\omega)=TS_a(\omega T_2)=2\sin \omega T/\omega$
My question
If the continue signal $x(t)$ is like:

It is a step shape wave. I sampled it by flat top sampling mentioned above. The rectangular pulse width is the same as the step width of $x(t)$. It is easy to find that the sampled signal is the same as the original signal. So the Fourier transform will not change before and after sampling. However, according the above equation $Y[\omega]=P(\omega)Y_\delta(\omega)$, the Fourier transform of the sampled signal is different from the original. What is going on?


texts:
What does exactly and precisely the term "fine-grained" mean in image segmentation?
For example, undeniably, the picture below is a fine-grained image:

But is it correct to call below picture as a fine-grained image?

or

I think it means a picture with details. In my idea, by accepting this definition, every picture out there can be called "fine-grained".
Could anybody explain as precisely as possible what exactly a "fine-grained" image is?

Thanks in advance.


texts: First Order Hold discrete-time approximation to first order continuous-time linear system

texts:
Consider the following first order linear system described by:
$\tau \frac{d}{dt}y(t)=-y(t) + x(t)$.
I have seen a discrete time approximation to this system using a "First Order Hold" approximation of the form:
$y[k+1] = e^{-T/\tau} y[k] + [-e^{-T/\tau} + \tau/T(1-e^{-T/\tau})]x[k] + [1 - \tau/T(1-e^{-T/\tau})]x[k+1]$ where $T$ is the sampling period.
Can anyone show a derivation of this result?


texts: What is a low-pass filter for a sequence of tuples?

texts:
I am currently reading SEGMENTATION AND RECOGNITION OF SYMBOLS WITHIN HANDWRITTEN MATHEMATICAL EXPRESSIONS. There is one sentence I don't understand:

  The preprocessing stage is subdivided into three steps:

  smoothing the input data by lowpass-filtering.

In this context your data usually looks like this:

[[(x1, y1), (x2, y2), ...],
 [(x12, y12), ...],
 ...
]

So you have list of coordinates that are ordered by time. Each sublist is exactly one line or a single point.

I've only heard of low-pass filters in the context of acoustics / electronics so far (I don't know much about these topics). In those contexts it's obvious what it means to let low frequencies pass / cut high frequencies.

So what is a low-pass filter in the context of handwritten symbol recogntion?


texts: What is the flow of data from a wifi receiver to the application layer?

texts:
I am not sure if I should ask this here but I am researching to build a receiver similar to a wifi one. I don't know here to look to find the flow that the data goes through.

For example, what I believe right now is that

the data stream gets captured by the antenna.
Now you have data to work with and it either gets put into packets in the receiver or in the computer.
Once in the computer, I assume it goes through a device driver for the wifi (usb for example).
Then from there I don't know where it goes.

If you can point me to a
   resource that would help with creating and programming a receiver for
   a different spectrum, that would be awesome. Thanks


texts: does audio feedback consist of harmonic content?

texts:
So sound from musical instruments as well as human voice consists of harmonics. just wondering if feedback from speakers also have harmonics component
I have heard that feedback does not consist of harmonics, whereas from other sources, it says that it consists only odd harmonic frequency content. so which is true?


texts: How to compensate the energy of a spectrum after using a Tukey window

texts:
I am trying to minimise the noise in a spectrum of a variable. I have divided the time history in equal parts, I have multiplied every part of the time history by a Tukey window, done a FFT of each one of this window. After this procedure I have an adequate signal, I have a question:
Should I compensate the energy lost with the Tukey window? and how?


texts: Computationally 'lightweight' smoothing in realtime

texts: I have a pitch tracker that can be quite unsmooth in its output (in Hz). A Savitzky-Golay filter has been good at smoothing but it looks like it adds a lot of multiplies on top of the already intensive O(N^2) multiplies from the autocorrelator doing the pitch tracking. Should I just do linearly interpolate between the previous point, or the point before that? What else can I look into? Will a single lowpass biquad deal with it?


texts: Can signal processing be applied successfully to price data from financial markets?

texts: Price/volume data from financial markets are like signals. Can these information be applied to signal processing to generate profits successfully?


texts: I have a line with known starting and ending 'x' and 'y' coordinates. I want to extrapolate three more between x and y points in MATLAB. I tried to find a lot but I couldn't get any help regarding extrapolate. Anyone please help me in this.


texts: Reconstruct phase while preserving magnitude

texts:
I was wondering if anyone could help me with this problem, I'm fairly new to audio signal processing so please bear with me.
My ultimate goal is to, given a magnitude, reconstruct an audio clip from said magnitude while preserving the magnitude exactly.
I have looked at a variety of methods for phase reconstruction (e.g. griffin-lim & variants); however, they don't seem to actually preserve the magnitude itself (with griffin-lim the relative error in the magnitude was ~10%).
Is there a way to reconstruct phase that exactly preserves magnitude and avoids complex signals when inverting with ISTFT? (note: poor audio quality is not a huge issue)


texts:
How many bytes would I require to store few seconds of fan controller PWM signal?

Such PWM is typically around 25Hz, so I think I need to sample it at 50Hz, right?

But what about the bit depth? Since it's a pulse wave (and such takes only values 0, 1 I believe) then 2 bits does suffice, right?

So is the computation then:

50 times per second * 2 bits per sample = 100 bits per second = 12.5 bytes per second of signal?


texts: QAM Constellation Construction - Basic 4/8 QAM

texts:
I wanted to know how to construct the set of amplitudes/phase for QAM modulation. I saw that a QAM signal can be represented as:
$$
s_m(t)=A_{mi}g(t)\cos(2\pi f_c t)-A_{mq}g(t)\sin(2\pi f_c t)
$$
where $A_{mi}$ and $A_{mq}$are two amplitude levels and $g(t)$ is the pulse. The resultant amplitude is given by:
$$
A_{ra}=\sqrt{A_{mi}^2+A_{mq}^2}
$$

And the resultant phase is given by:
$$
\theta_m=\arctan\left(\frac{A_{mi}}{A_{mq}}\right)
$$

Given the above, what values should I take for the amplitude levels so that I will get the resultant amplitude and phase?

I tried generating the amplitude and phase values for simple 4 QAM by taking 2 different amplitude levels and 2 different phase levels like below:
$$A_{mi}=\left\{-1, 1\right\}, \quad A_{mq}=\left\{-1, 1\right\}$$

Then plotted the 4 possibilities (which seems pretty overlapping): Its clear that I need to take different amplitude levels for inphase and quadrature carriers. But is there any generalized formula for $A_{mi}$ and $A_{mq}$ so that I can generate my resultant amplitude and phase for QAM?

$$
\begin{array}{|c|c|c|c|}
\hline
A_{mi} & A_{mq} & A_{ra} & \theta_m\\\hline
-1 & -1 & \sqrt 2 & \frac \pi4\\\hline
-1 & 1 & \sqrt 2 & -\frac \pi4\\\hline
1 & -1 & \sqrt 2 & -\frac \pi4\\\hline
1 & 1 & \sqrt 2 & \frac \pi4\\\hline
\end{array}
$$


texts: How to calculate the Gain (in dB) given ω₁ and sampling time, T, of a discrete transfer function?

texts:
Having the Transfer Function of a discrete system as such:

$$H(z) = (1.011)\frac{z-0.9756}{z-0.9975}$$

How would you find the gain at ω₁=3 rad/s at a sampling time of T=0.25 seconds.

The answer to the solution is: 0.1013 dB

I'm having problems with this. I am aware that $z=e^{sT}=e^{jωT}$. I substitute the values of ω₁ and T, and it always results in a complex error, despite attempting it multiple times.

Could someone help how you would get the final solution, with steps provided?

Kind regards,
Alan.


texts:
I am wondering if "an array of overlapping band-pass ﬁlters" it is 'mostly' equivalent to a Short-Time Fourier transform. See this (figure down), where $s(t)$ is the signal;
LPF a second-order low-pass ﬁlter with a resonance frequency of 4 kHz; BPF an array of band-pass ﬁlters, where frequencies that are spaced equidistantly on
a critical band scale; HCM a hair cell model which is assumed identical in all channels, and finally a low-pass ﬁlter at 1250 Hz does an envelope extraction of the patterns in each channel. Processing a signal with this method produces a matrix of intesities that are vertically distributed like in STFT.

What are the differences between  them? Could be improved with wavelets as basis?

Thank you in advance. All comments will be rewarded!


texts:
I'm really new in image processing, so please sorry I'm a newbie. I tried to use the squares.cpp for detecting posters (since they usually are rectangles) without using expensive feature detectors (like SIFT). Unfortunately, the results are pretty much disappointing (as it was pretty predictable, results below).

Actually I don't care that only posters are detected, since statistically the posters are the biggest (or second biggest) rectangle in the image (decent heuristic).

The last image is the result of this code using this Hough Transofrm code (which seems working even worse!).

Any idea how to improve this code?

[


texts: Why do digital images use the concept of ‘Stride’?

texts: … why are Width and Height not sufficient to work with digital images?


texts: Overlap-windowing vs preserved information

texts:
When windowing non-overlapped segments of data stream, part of the data is being "ignored" at the boundaries of the segments due to the tapering of window functions (non-rectangular). Some information is lost in further processing.

My question is: for a given window function, does overlapping the segments by $50 \%$ preserve $100\%$ of the data stream information ?


texts: Kalman filter for tracking sinusoidal motion

texts:
I am wanting to create a Kalman filter that can be used to track an object undergoing sinusoidal (lets assume simple harmonic) motion. I have seen many examples and implemented my own python code for a simple SUVAT equation/projectile motion case however I have been having trouble finding examples where a Kalman filter is used to track an object moving with sinusoidal motion and I have been having trouble working out how to construct the State transition matrix (commonly called A) and the Control matrix (commonly called B) to model such behaviour.

This will eventually be used to track a noisy voltage signal corresponding to the position of an oscillating object such that one can recover it's 'true' motion.

I would appreciate if someone could direct me to some useful resources where I could learn how to do this or explain how I might go about doing this.


texts: How do I find the transfer function of a speaker by analysing the audio produced by it?

texts: I have the original audio signal(MATLAB GENERATED) and the recorded audio signal (anechoic conditions). The setup consists of a DAC with a power amp plugged into the speaker. The audio is recorded via a condenser mic. I need to realize the transfer function of the speaker even though the properties of the rest of the setup are unknown.


texts: How to know if the noise was removed in an image?

texts:
I am looking for a technique for measure the quality of my denoise filter, is the SNR formula useful for that purpose?

My problem is, I have an image with noise, I apply the "adaptive median filter", how to know if the noise has decreased?


texts: harmonic product spectrum on guitar string signals

texts:
i am trying to create a program that gets the fundamental frequency of the signal coming from a guitar string to identify what note is being played, is harmonic product spectrum the algorithm the most suitable in getting the fundamental frequency? is there any algorithm to use that can be used real-time?

also i am using matlab simulink to implement this algorithm to arduino

all answers are deeply appreciated, thank you in advance :)


texts: How to measure the frequency response of an acoustic filter by input and output signals

texts:
I am trying to measure the frequency response of acoustic filter. I sample the sound before propagation in the filter and after by 2 different mics. And now I am trying to find the system (the acoustic path) frequency response.

Using matlab how can I do it?

I tried the identification app but the result is not so reliable and fails if the signal is changed.
I tried $\displaystyle\rm H=\frac{\lvert FFT(output)\rvert}{\lvert FFT(input)\rvert}$ but the result is bad too.

UPDATE: After running this code:

[y, Ss] = audioread('4.wav');

h = fir1(30,0.2,rectwin(31));
y_f = filter(h,1,y);

[Txy,f] = tfestimate(y,y_f);
figure;
plot(f,mag2db(abs(Txy)))

I am getting:

What I doing wrong?


texts: How to reduce frequency resolution for high sampling rate and lot of samples?

texts:
I'm kinda new in this field, and I have a following situation. There is a 1s long audio signal, with Fs = 96000Hz, and I have 96000 samples accordingly. If I do a single FFT on the entire signal, I get this 1Hz frequency and 48000 points, resulting in a very "fat" logarithmic spectrum, like in the picture below.

How can I reduce resolution and thin out my plot without reducing sampling rate?

Thanks in advance.


texts:
Basically, (I know I've asked a simular question, but I have been away and really thought about it this time)!

Let me try and explain this in the best way possible:

Basically, I'm attempting to create an algorithm that takes a voice sample (.wav)
of someone saying either "Yes", or "No".  Now, in order to do this I am attempting to split the sample into equal blocks in order to get the Phones.

Now, I have thought about this..

I don't need to technically analise all of Phones, I can identify if the the sample is either "Yes" or "No" by just looking for a "Y" Phone. Because if a "Y" doesn't exist then the sample is "No". So, I can handle this by implementing a decision tree.

Ok, so to my question. I know that this can be achieved using Zero-Crossing, but, I don't have any experience in this (Ok, people are going to tell me to stop doing it then) but, we all had to learn somewhere, right?

If someone could possibly link me to a website or a book where I can learn about the Zero-crossing method? Then it would be great.

The main thing I don't understand about it is, how can Zero-crossing determine whether the Phone is a "Y"? Or, will I need to have some samples of "Y" in order to match through Correlation?, or something.

I hope someone can advise me.

Thanks :)


texts: Interpolation of estimated frequency between fft bins: what about phase?

texts:
I am developing an additive re-synthesier, which involves identifying partials from FFT frames.

Partial identification requires amplitude peaks.  The simplest way to do this is to just look at the amplitude of each bin, but this of course can miss partials that happen to lay between bins, and there energy is spread over the two adjacent bins.

I understand there are various interpolation methods (of varying complexity) to estimate the actual amplitude peak and frequency... however, if taking such an approach, how to estimate the phase offset?  Is it even possible?


texts:
I'm working on a piano tuning program and part of it requires real-time pitch detection.  Here is the scheme I have so far which works to some degree but could probably use some refinement.

I'm capturing mono, 44.1kHz, 16-bit PCM audio in chunks of 2^14 samples.  I combine the last 4 samples into a 2^16 length buffer, apply a Hann window to the buffer and run a FFT on it.  Then, I bucketize the results of the FFT in two resolutions.  First, I bucketize into 200 buckets and then run the HPS pitch detection algorithm at this granularity.  I don't need to get an exact frequency here, I just want to get close.  Then, I bucketize into 12000 buckets which gives me 1 cent resolution from 10Hz to 10kHz.  Once I know an approximate frequency from the 200 bin HPS algorithm, I search that range of the 12000 bin case for a peak to get a more exact frequency.

This seems to work okay for the notes in the middle of the keyboard.  What happens with the low notes is about 1.5s of mis-identification of the note as usually the 2nd or 3rd partial of the real note and then a correct identification of the note.

In all of the spectral plots I created to see what is going on, there is more width to the peaks that I would expect.  This width is visually somewhat consistent from the 200 bin to 12000 bin case.  I would have expected the peaks to be narrower in the 200 bin case.

So, signal processing is new to me so there may be things that are problems that I wouldn't think to ask about but in terms of specific questions, are the sample sizes sufficient for this task?  Is Hann the right choice of window?  Should I smooth the data as well before FFT?  How sensitive is HPS to the number of bins?  I was thinking that if I used a lot of bins then inharmonicity might not make partials overlap their fundamentals with the HPS algorithm's simple approach of dividing by 2, 3, 4, etc.


texts: Hardware implementation of Gaussian noise generator

texts: I am implementing a GNG using Verilog. The implementation is based on the IEEE paper "Hardware Architecture of a Gaussian Noise Generator Based on the Inversion Method". In this, i could not understand what exactly does the ROM_trans block needs to store. I understand it is a lookup table, but I do not know what to store inside it. Also how will I determine the coefficients that need to be stored in the ROM_coef block.


texts: How can I infer the cost function from Kruppa's simplified equations

texts:
The following equations are Kruppa's simplified equations used in camera autocalibration. My objective here is to infer the cost function(Error Function) from this equations, So I can minimize the cost function through Levenberg-Marquardt nonlinear optimization algorithm.

(I already did the part of optimization, and only need the cost function in mathematical form so I can implement it).

I have read this paper, and this paper about this specific topic, but I didn't understand the complicated math inside.

Can anybody explain how the mathematical cost function will look like in simple language?

Thanks in Advance

$ W^{-1} = K K^{T}$,

where $W^{-1}$ is the dual of $IAC$, $K$ is the camera intrinsics matrix

$r,s$ are the first, and the second singular values of $S$

$u_1, u_2, u_3$ are the column-vectors of $U$,

$v_1, v_2, v_3$ are the column-vectors of $V$,

$USV = SVD(Fundemental\quad Matrix\__{ij})$,

and $i,j$ are two different images from moving camera.


texts: How was this result on discrete Fourier series achieved?

texts:
I was trying to do the question 10, part b of the following document (https://ocw.mit.edu/resources/res-6-007-signals-and-systems-spring-2011/assignments/MITRES_6_007S11_hw10.pdf)

I was going through the solution(https://ocw.mit.edu/resources/res-6-007-signals-and-systems-spring-2011/assignments/MITRES_6_007S11_hw10_sol.pdf). Can someone explain to me how they reached from step 3 to answer to part b) of the 10th question. I understood till step-3 of the solution.


texts: Requirement of time step in convolution output?

texts:
I am studying time domain analysis from book

signals and systems labotary with matlab

by alex palamides

when i was studying convolution command topic on page 187, author discussed use of time step with convolution command as shown in attached photo

Although comments and description written there but i couldn't understand its benefit/significance
Please kindly explain third rule especially
i am confused why he is using step there,why not go on without step?


texts: Trignometric Fourier series representation of a continous time signal

texts:
While learning Fourier series I read the definitions of representation for a continuous time signal $x(t)$ as:

$$x(t)=A_0 + 2 \sum_{k=1}^{\infty} A_k \cos(k \omega_0 t) - B_k \sin(k \omega_0 t) \tag{1}$$

where $A_k$ and $B_k$ are real.

Another definition was:
$$x(t)=a_0 + \sum_{k=1}^{\infty} a_k \cos(k \omega_0 t) + b_k \sin(k \omega_0 t) \tag{2}$$

Why two different definitions?  I mean in $(1)$ there is a coefficient of $2$ for sinusoids and sine coefficients are negated.


texts: Square pulse test of Upwind Finite Differences

texts:
I`m analyzing the numerical methods for the 1D convection equation for stability, consistency, and accuracy. I want to see How does this square pulse move in domain and time?
Here is my code
% Convection equation -  Ct + u * Cx = 0;
% IC: C(x,0)= x, 0<=x<=0.5; C(x,0) =(1-x), 0.5<=x<=1;
% u = 0.1 m/s
% Explicit Upwind Method
%  nu = udelta_t/delta_x <= 1
% nu is CN - Courant Number = Beta
clear vars
clf
clear plot
clear
clc
u = 0.1; % convection velocity, m/s eg 0.1
L = 100; % Distance, m
m1 = 10; % number of spatial segments
delta_x = L/m1 % Domain discretization
m = 10; % Graphing distance
nt = 500; % Total time, s
n = 10 % number of time steps
delta_t = nt/n
nu = udelta_t/delta_x; % Beta (for stability purposes)
sf = 11; % graphical scaling factor; note sfL, eg 11
x = zeros(m+3,1); % location along the x direction
x(1) = 0;
for i = 1:m
x(i+1) = x(i) + delta_x;
end
x
t = zeros(n+1,1);  % Time at different steps
t(1) = 0;
for i = 1:n
t(i+1) = t(i) + delta_t;
end
t
C = zeros(m+3,n+1);
% Initial Condition
for i = 1:m
if (x(i) >= 0) && (x(i) <=L)
C(i,1) = 1;
elseif (x(i) > 0.5) && (x(i) <= L)
C(i,1) = x(i);
end
end
% Boundary Conditions
% Interior nodes
for j = 1:n
for i = 3:m
C(i,j+1) =nuC(i-1,j) + ((1-nu)) (C(i,j));
end
end
C(1:m+3,1);
C(1:m+3,n+1);
% C(2,:) = (1.2)(C(1,:) + C(3,:));
disp([' courant number, nu = ',num2str(abs(nu))]);
%{
plot(x,u(1:m+1,n))
grid on
title(['Upwind method, Initial Displacement profile, time  = ', num2str(nt), ' s,  at Courant Number, nu = ', num2str(abs(nu))])
xlabel('Distance (m)')
ylabel('Velocity (m/s)')
%}
% Plot
Tvector = C(:);
Tmax = max(Tvector);
% Concentration Profile Initial
subplot(2,2,1)
plot(x,C(1:m+3,1))
grid on
axis([0 sfL 0 Tmax])
title(['Upwind, Initial Concentration profile, time  = ', num2str(t(1)), ' s,  at CN, nu = ', num2str(abs(nu))])
xlabel('Distance (m)')
ylabel('Concentration (mg/L)')
% Concentration Profile Final
subplot(2,2,3)
plot(x,C(1:m+3,n+1))
grid on
axis([0 sfL 0 Tmax])
title(['Upwind, Final Concentration profile, time  = ', num2str(nt), ' s,  at CN, nu = ', num2str(abs(nu))])
xlabel('Distance (m)')
ylabel('Concentration (mg/L)')
%plot(t,heaviside(t+1).heaviside(2-t))*


texts: Correct way to quantize accelerometer data with microsecond precision?

texts:
I am analyzing large volumes of raw accelerometer data (~12 hours @ 200Hz) using Python. Some calculations (e.g. deriving Jerk) necessitate a time index with a regular interval. I have microsecond-precision time associated with my data but I can see variance in the +/- 80μs range. Which method of time quantization will help me achieve a regular time interval while introducing the least amount of error?

I'm a DSP novice so please excuse and correct me if I'm misusing any terminology


texts: How is a "good" or "bad" singer defined in signal processing terms?

texts:
I was watching the American and Indian idol auditions on youtube earlier in the day. I watched both successful and failed contestants and I was able to distinguish the really bad from the good singers even if I did not recognize the song or had ever heard the melody. Among the good singers, however, my limited knowledge of music prevented me from further discerning how good or bad they were. That set me thinking and I have the following questions to ask:

When we say that a singer is "good", what do we mean by it in signal processing terms?
What factors/characteristics should we consider when we say (with some authority) that the person is a "good" singer? Is it pitch, the "tune", "melody"? How much weight should these (and other parameters) have when taking such a decision?
How important a role would pitch play in this? I mean, if a man was to sing My heart will go on in perfect tune (with low pitch), would he get a score higher than a woman who sang the same song (but much less perfectly)?
When the contestants are shown singing, there is no background score playing. Yet, we are able to figure out who is singing well and who is not. So does that mean that the background score is pretty much irrelevant when it comes to deciding good/bad singing ability?
Can the above points be extended to all types of songs and genres? For instance, in most classical music (vocal), the singer is pretty much primary. The instruments etc. are present simply to aid the singer. These songs are tougher to sing (any Hindustani classical or Largo al Factotum). Songs from rock/heavy metal (We will rock you/Suicide blonde) are a little easier to sing (IMO), because the instruments are primary and vocals are secondary.
How do we (if at all) compare two songs?

I suppose that the above problem would eventually lead me to look at karaoke scoring algorithms, of which there are good open-source options (Performous, UltraStar Deluxe etc.). But before I look at these in detail, I thought it would be great to put this out and see what ideas others in the community (with a far greater knowledge of music and ability) have on this.

P.S: Reference to some papers/material on this would be great.

P.S: Some of the above examples/points are my opinions. Given what I know about music, they may be way off the mark. Please feel free to add/suggest more questions or correct opinions I may have expressed. I will be only too happy to make the necessary edits.


texts:
First of all ,please let me know?Is cosine time invariant or time variant?
If latter is the case then if a time varying input like cos is given to a time invariant system,how will it behave?

I have a system $y(t) = x^2(t)$
Apparently from equation it seems to be time invariant
But when i give it input $x(t) = \cos(2 \pi t)$
I do not get time invariant response as shown through following matlab code
Although people are commenting that my system is still time invariant but as shown highlighted in attached photo y(t-3) span is between 3 to 13 while S[x(t-3)] span is between 0 to 10 but as by book both of them should have same time span?I am confused in this difference in time span

clc
clear all
close all
t=0:.001:10;
x=cos(2*pi*t);
y=x.^2;
subplot(3,1,1)
plot(t,y)

legend('y(t)')

subplot(3,1,2)
plot(t+3,y)

legend('y(t-3)')

xn=cos(2*pi*(t-3));
y2=xn.^2;
subplot(3,1,3)
plot(t,y2)

legend('S[x(t-3)]')


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

texts:
In standard MRA we have that the space of functions at scale J can be expressed as
$$V_j = V_0\oplus \left(\bigoplus_{j=0}^{J} W_j\right)$$
where $V_0$ is spanned by the orthonormal system of the translates of the scaling function $\phi(x)$, i.e. $V_0 = \overline{\text{span}}\{\phi(x-k)\}_{k\in\mathbb{Z}}$ and the detail spaces $W_j$ are spanned by the wavelets ,i.e. $W_j = \overline{\text{span}}\{\psi_{j,k}\}_{k\in\mathbb{Z}}$, being $\psi_{j,k} = 2^{j/2}\psi(2^j x - k)$ and $\psi(x)$ the mother Wavelet. From the two scales equation and from the wavelet equation we obtain the iterative algorithm to compute the coefficients at the coarser scale from those of the finer one. That is, given a function $f(x)$ in $V_J$ (which can be for instance an approximation of another function up to such scale) then since by definition of MRA we have that $\{\phi_{j,k}\}_{k\in\mathbb{Z}}=\{2^{j/2}\phi(2^jx-k)\}_{k\in\mathbb{Z}}$ spans $V_j$, we can compute the coefficients $a_{J,k} = \langle f,\phi_{J,k} \rangle$ and then I can compute the coefficients at each scale $0\le j<J$ as
$$a_{j,k} = \sum_{l\in\mathbb{Z}} h(l-2k)a_{j+1,l},\qquad b_{j,k} = \sum_{l\in\mathbb Z}g(l-2k)a_{j+1,l}$$
where $b_{j,k} = \langle f,\psi_{j,k}\rangle$ and $h(n)$ and $g(n)$ are the scaling and wavelet filters, such that $$\phi(x) = \sqrt{2}\sum_{k\in\mathbb Z} h(k)\phi(2x-k),\qquad\psi(x) = \sqrt{2}\sum_{k\in\mathbb Z} g(k)\phi(2x-k)$$
So, once I have $a_{J,k}$ I can compute the whole decomposition, making filtering and all the operations I want and then re-synthetize the function inverting the iterative relation among the coefficients and rewriting
$$ f = \sum_{k\in\mathbb Z} a_{J,k}^{new} \psi_{J,k}$$
The problem is, in order to start the whole I need to compute the scalar products
$$a_{J,k} = \langle f,\phi_{J,k} \rangle$$
How I can I do it is I only have some samples of $f(x)$, say $\{f(x_i)\}_{0\le i\le N} $ ? (note that the samples can also be not equally spaced).
The solutions I heard about are
1) Use the low of large numbers and approximate
$$\hat{a}_{J,k} = \dfrac{1}{N}\sum_{i=1}^N f(x_i)\phi_{J,k}(x_i)$$
2) Solve the system of N equations
$$ f(x_i) = \sum_{k} \hat{a}_{J,k}\phi_{J,k}(x_i)$$
The first one is the simplest, and has the advantage that it can be computed very fast as a new sample arrives, however it has the problem that many coefficients will be undefined and many will be defined with very few terms. The second asks to solve a possibily big system of equations any time a new sample arrives. Are there any smart way to compute the tarting coefficients $a_{J,k}$?


texts: Transfer function given as z-Domain fraction: gain calculation

texts:
I am stuck on a question regarding transfer functions. I have the answer and have attempted the question but am having trouble solving it.

Q: Given the transfer function of a digital filter is (5z-5)/z, compute the gain (in dB) of the digital filter at the cutoff frequency (10 rad/s)

The answer given is 14.65dB. (or a gain of 5.401)

I am unsure how to do this:

I see that the transfer function can be rewritten as 5(z-1)/z leading me to believe the gain would be 5 which is 13.98 dB, more than half a dB off.

What am I doing wrong here?


texts: Calculating the modulation based on the coordinates in the constellation diagram

texts:
A constellation diagram has points at the following coordinates: (2,2), (2,-2), (-2,2), (0,-2). What is the modulation used by the modem?

This is literally never explained in my textbook and I can't do it by logic, since I have NO clue what a constellation diagram is.


texts: Extracting motion vectors from H.264 bitstream

texts:
I'm looking for an open-source tool/code or some guidance to extract the motion vectors (MVs) of a H.264 encoded bit sequence. I'm already aware that motion vectors can be visualized using ffmpeg with the following command:

ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb

However, I want to produce a log file where the MVs of P and B frames are listed frame by frame. I checked out the structure of MVs from libavutil/motion_vector.h, but I couldn't find an example which shows how they are extracted and laid over the original sequence by ffplay. I thought that if I can find that out, I could possibly re-arrange the code to extract the MVs to a text file.

I would appreciate any example codes or hints.


texts:
I am trying to understand the algorithms of channel coding. Regarding the conventional channel which is, for me, the easiest one to implement, I have a question regarding the output of its decoder.
When using encoder whose rate is 1/2, the output of the decoder is half of its input, for example:
constlen = 7;  codegen = [171 133];
tblen = 32;     % traceback length
trellis = poly2trellis(constlen, codegen);

X = randi([0 1], 1024,1);        %The data to encdoe
Y = convenc(X, trellis);        %Performing of coding
Y_dec = vitdec(Y, trellis, tblen, 'cont', 'hard');  %The decoder

As you see, in last line, Y_dec is of length 1024. However, its input Y has a length of 2048. What I need is to show the whole corrected outputs, I mean I need to have the output Y_dec of length 2048 which includes the data and the redundancy. Is that feasible?
EDIT:
Following Dilip's feedback, I could get back it as below:
constlen = 7;  codegen = [171 133];
tblen = 32;     % traceback length
trellis = poly2trellis(constlen, codegen);

X = randi([0 1], 1024,1);        %The data to encdoe
Y = convenc(X, trellis);        %Performing of coding
Y_dec = vitdec(Y, trellis, tblen, 'cont', 'hard');  %The decoder
Y2 = convenc(Y_dec(1+tblen:end), trellis);
Y3 = Y(1:end-2*tblen) - Y2;     % This is Zero

But as you see, it means that a part of code word can be found which is Y2 = Y(1:end-2*tblen). however the code word size is $2048$, so is there a way to get all the codeword?


texts: Does a power spectral density that follow a power law imply that the time hisory follows a power law?

texts:
This is a question related to this previous question "I cannot find reference (paper) of this relation $u(t)t^{α} ↔^{FT} f^{-(α+1)}$".
The signal that I work with g(t), is the time history of a velocity component flucutuations. This signal comply with the rule:
$\bar{g}=lim_{T->+\infty}\int_{0}^{T}g(t)dt=0$
The Power spectrum of g(t) follows in a frequency range a power law "-5/3", in other frequency ranges the  slope can change. (SEE for example, figure 1 [here])2.
The power law frequency range, following the rule $u(t)t^{α} ↔^{FT} f^{-(α+1)}$ should imply that also the time history has a power law. The signals I work with does not seems to have a power law.
Is this can be due to a masking performed by the behaviour of the other frequency range? The rule
$\bar{g}=lim_{T->+\infty}\int_{0}^{T}g(t)dt=0$
can violate some hypotheses at the base of $u(t)t^{α} ↔^{FT} f^{-(α+1)}$" ?


texts: $Q$ factor refers to what on a lowpass filter? (EE kind of definition)

texts:
For what I'm learning, the bandwidth (of a BPF, for example) refers to the $\Delta$ between $f_L$ and $f_H$ at (usually) $-3\textrm{ db}$ from the $f_0$ (from wiki). For a peaking filter instead, $f_L$ and $f_H$ are situated (usually) at the peak $\textrm{dB Gain}/2$.

Q Factor become $f_0 /\Delta$. It's clear till here.

Now, if I take a lowpass filter, how is calculated $Q$ Factor?
I have $f_0$, but how would I calculate the $\Delta$ of a lowpass?

There is no a "peak" as reference, so $-3\textrm{ dB}$ (or $\textrm{dB Gain/2}$) make no sense as references points for the "created" bandwidth.


texts: Frequency and phase range of the FFT of an image

texts:
I have some questions:

1. What is the horizontal and vertical frequency range (and the steps) of
    the FFT amplitudes of an image?

2. What is the relevant axes range for the phase image?

3. Which sector is physically relevant?

May be you can explain it for the following image:

of which the FFT amplitude image is:


texts: Why does carrier frequency offset (CFO) cause carrier phase error (CPE)?

texts:
I've already asked 2 questions on this but there is one discrepancy I cannot reconcile and is the crux of the problem:
\begin{align}
\newcommand{\prefix}{\frac1N\sum\limits_{n=0}^{N-1}}
R_l &=
\prefix r[n]e^{-j2\pi \frac lN n}\\
&=
\prefix\sum\limits_{i=0}^{N-1}X_i\,
    e^{j2\pi \frac iN n} \,
    e^{-j2\pi \frac lN n} \,
    e^{j2\pi \frac {\varepsilon}N n}\\
&=
X_l \prefix e^{j2\pi \frac {\varepsilon}N n}
+
\sum\limits_{n=0}^{N-1}\sum\limits_{i=0, i\ne l}^{N-1} X_i e^{j2\pi \frac{i-l+\varepsilon}N n}\\
&= \alpha X_l \underbrace{\color{blue}{e^{j\pi\varepsilon\frac{N-1}N}}\phantom{\hspace{-7.5em}\sum\limits_{i=0, i\ne l}^{N-1} X_i e^{j2\pi \frac{i-l+\varepsilon}N n}}}_\text{CPE}
+
\underbrace{
  \color{darkgreen}{
    \sum\limits_{n=0}^{N-1}\sum\limits_{i=0, i\ne l}^{N-1} X_i e^{j2\pi\frac{i-l+\varepsilon}N n}
  }
}_
{\text{ICI}_l}
\\
\end{align}
Here it quite clearly shows how the original frequency values get rotated by the CFO frequency i.e. $X_l$ is attenuated and phase rotated and the other subcarrier quantities at that frequency is the ICI
But I cannot reconcile this with what CFO actually does, which is shift the frequency domain. The frequency domain should consist of sincs in the imaginary and real domains at the heights of the constellation points.
Imagine the constellation point $2j+2$ as $X_l$:

When this is shifted, the result of the DFT will be a sampling the point of the cross in the frequency domain. This does not change the phase, only the magnitude, because it will now be $1.7j+1.7$ at that frequency as shown.
I just cannot reconcile this latter scenario to show the phase rotation of the first scenario, when the imaginary and real part are of the same magnitude, there is no phase change


texts:
I'm using a sensor with output that looks like the following figure.

The cyclic noise is common to ask measurements made by the sensor. Is there a way to remove the noise without negatively effecting higher frequencies.

We have attempted using a Fourier transform and then zeroing the frequencies around 6 Hz in Matlab, but that was ineffective.


texts: How to "draw" the function/wave to send symbols using QAM?

texts:
Say you have the following 8QAM constellation diagram:

Say, you want to send the sequence:

001 110 101 000 001

How would you draw the function/wave containing the symbols?

My problem in understanding this is:

I know you use amplitude and phase shifting for defining symbols. Each symbol has a complex function like this:

$$g(t) = A \times e^{i(ft + \phi)}$$

($A$ = amplitude, $f$ = frequency, $\phi$ = phase)

You have one function for each of the possible symbols. But how do you draw the sequence of symbols (or even one symbol)? Isn't $e^{ix} = \mathrm{cos}(x) + i \times \mathrm{sin}(x)$ ? Do I draw the real part or the imaginary part?

Thanks!


texts: I'm having a tough time understanding the phase increments which are quadratic in nature in the chirp signal. When I see consecutive samples, what will I see in terms of phase and if I have to measure the phase difference between the two samples, what will I see ?


texts: It's well known that magnitude of the analytic signal for narrowband signals gives the envelope. For example we can demodulate AM signal by abs(hilbert(s_AM)) in MATLAB. I'm looking for the exact mathematical conditions which specify when we get the envelope by computing $|s(t)|$. By analytic signal, I mean $$s(t) = x(t) + j\hat{x}(t)$$ Where $\hat{x}(t)$ is the Hilbert transform of $x(t)$, $$\hat{x}(t) = \frac{1}{\pi t}*x(t) = \frac{1}{\pi}\int_{-\infty}^{+\infty}\frac{x(\tau)}{t-\tau}d\tau$$Magnitude of $s(t)$ is $\sqrt{x^2(t) + \hat{x}^2(t)}$ and I don't know how to proceed further.


texts: What is the relation of the transition band's width and the filter order for the FIR windowing method

texts: When designing an FIR filter using the windowing method, how can one estimate the filter order ? It's obvious that the type of window and the transitions band's width has some effect on the order.


texts: Inverse Discrete Time Fourier Transform of a given Function using the definition

texts:
I would like to compute the Inverse Fourier Transform of a given function using the DTFT definition

$$H(e^{jω})=\frac{1}{(2−e^{jω})(2−e^{−jω})}$$

But I have to use the definition of the DTFT
$$H(e^{j\omega}) = \sum_{n = -\infty}^{n = \infty}{h(n) e^{j\omega n}}$$

My approach was that I assume that $x=e^{jω}$, which then gives the equation

$$H(x) = \frac{1}{(2-x)(2-x^{-1})}$$
Now I can apply partial fraction decomposition.

Is my approach correct?


texts: The Least Norm Solution of Under Determined Linear System

texts:
Suppose I have a matrix

$$A=
\begin{pmatrix}
1 &  0  & 1 & 0\\
0  &  1 & 1& 0\\
\end{pmatrix}
$$

where the variables are channel information like assume $X_1$, $X_2$, $X_3$ and $X_4$. Considering the typical least-squares problem

$$Y= AX+b$$

However, matrix $A$ is fat and, thus, $A^{T} A$ is not invertible.  I cannot get $X_3$ or $X_4$ and they will be zero. I can use regularization and optimize joint least-squares and least-norm problem but that does not give me the same $X_1$ and $X_2$. Is there any way to solve this problem?

I tried to stack all the received vectors into matrix $Y$ and do the same for $A$ and $b$ to make matrix $A$ fat. However, due to the structure of $A$, it is still not invertible. Does anyone know how to solve this problem? Can I recover the solution for parameters based on what I get from regularized solution?


texts:
I am currently working on some noise removal algorithms and have come across what seems to be an oversight in the design of some of these algorithms.
Two of the algorithms I am looking at use the PSD of the noisy input signal, and calculate the gains that should be applied to retrieve the noise-free signal.
However, both of these algorithms specify the gains should be $\in [0,1]$, with one (an autoencoder) specifying a sigmoid activation should be applied to its output to limit the gains between these values, and another mentioning the gains are $\in [0,1]$. In reality, however, the gains can be any positive integer.
Consider a signal $SN$ that is the sum of two signals $S$ and $N$, where $S$ is our noise-free signal and $N$ is our noise. Then, to calculate the (relative) PSD of these signals, we take the FFT of each, and square the absolute value. Now, given $\mathcal F\{x\}$ is the real FFT of $x$, and assuming our signals are real valued:
\begin{align}
SN &= S + N\\
\mathcal F\{SN\} &= \mathcal F\{S\} + \mathcal F\{N\}
\end{align}
However;
$$
\big(\mathcal F\{SN\}\big)^2 = \big(\mathcal F\{S\} + \mathcal F\{N\}\big)^2 \neq \big(\mathcal F\{S\}\big)^2 + \big(\mathcal F\{N\}\big)^2
$$
Therefore, there are some cases where our speech signal, for a given frequency, may have more power than our combined signal, hence our gains should be $> 1$.

Why do the algorithms I have read assume gains should be $\in [0,1]$? Is this because we cannot be certain as to the nature of the input, and so letting the gains be $> 1$ could lead to much more disastrous artifacts?
And if the noise we are removing is well modelled, does anything stop us from setting these gains to be greater than the combined signal?


texts: FFT of audio, packet sampling and others

texts:
Hi I am just toying around with compression now that we are learning about Fourier transforms in my class (compression is not a part of the class but I became a bit curious). Trying to do this with a wav file and I have some questions.

Assume I don't know the sampling rate of the signal (.wav) how can I figure out what the FFT frequency range is in Hz? I know that the bins are multiples of the sampling rate ($F_s$) divided by N, or they are factors of Fs, eg 0.1*$F_s$, 0.2*$F_s$ etc... but how does this help me find the sampling frequency in Hz, so I can actually see which frequencies are doing what?

Is there any clever trick in storing the coefficients of a real signal (wav)? They are always complex unless the signal is a pure cosine but what audio is? If I want to store the full range of coefficients I need at least as much storage as the .wav file (exploiting symmetry at the midpoint and having 2 units (real, imag) for every real input). This is of particular importance, if the coefficients are small they can be stored with less bits than the bits needed to represent the .wav datapoints.

Since for the case of functions you can split them in subintervalls and take the Fourier transform and depending on the result get some easier or more compact expression I was wondering if for the sake of compression I could split the audio-signal?

If I have a .wav file with N datapoints then split into ten N/10 segments and then fft on each segment. But this then means that my sampling frequency is essentially reduced to N/10 $F_s$? This seems intuitive, if I "zoom" into a rapidly osciallitaing function then in that window it will look very slow and appear to have a low frequency.


texts: If video uses color bars to test and align color values among TV sets, what could be the equivalent in Audio?

texts:
Are there any sample Audio files, encoded in the simplest format known, that can mathematically explain or illustrate the fundamentals of (audio) signal processing that might also relate to known equations of physics pertaining to audio?
I am trying to teach a robot AI system how to sing.


texts:
As I know if the impulse response is symmetric around sample zero phase response should be entirely zero.

The code below just set a rectangular window for vector "in"

const int N = 10;

// in = 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 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 + 2, 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) );
                              } );

I getting back a sinc like result in magnitude,
But I am so curious why I have values different than zero in phase :

    polarOut    <11 items>  std::vector<std::complex<double>>
        [0] (3.000000, 0.000000)    std::complex<double>
        [1] (2.682507, -2.855993)   std::complex<double>
        [2] (1.830830, 0.571199)    std::complex<double>
        [3] (0.715370, -2.284795)   std::complex<double>
        [4] (0.309721, -1.999195)   std::complex<double>
        [5] (0.918986, 1.427997)    std::complex<double>
        [6] (0.918986, -1.427997)   std::complex<double>
        [7] (0.309721, 1.999195)    std::complex<double>
        [8] (0.715370, 2.284795)    std::complex<double>
        [9] (1.830830, -0.571199)   std::complex<double>
        [10]    (2.682507, 2.855993)    std::complex<double>

Any explanation about the phase response of behaviour of this fft will be great.


texts: Shifting signal smaller than discrete step

texts:
I have a image that I need to shift with less than a pixel.

My plan was to do a Fourier transform and multiply the signal with $e^{-aiu-biv}$ where $a, b$ are the shifts in x and y direction. This might make sense in theory but in practice I don't really know how to represent $e^{-aiu-biv}$.

I am using numpy to do a 2d FFT of the image which, ofcourse, is represented as a matrix of complex values. From this point of I'm kinda lost, how do I multiply this with $e^{-aiu-biv}$?

It seems like fundamentally something is wrong as I need to temporarily represent the image in a higher resolution, shift is slightly and then collapse it back to the original resolution.


texts: What can we understand when we increase the $N$-point DFT for a given signal?

texts:
I have an input sequence $$x(n)=\cos(0.48\pi n)+\cos(0.52\pi n).$$ I am determining its spectrum (amplitude of DFT values) based on the finite number of samples.

For Example :

Taking the first $10$ samples of $x(n)$, $n=0, \ldots, 9$, calculating the $10$-point DFT of $x(n)$
Using the $10$ samples from part $1$, calculating and plotting the $100$-point DFT.
Taking the first $100$ samples of $x(n)$, $n=0, \ldots, 99$, ploting the $100$-point DFT of $x(n)$.

Questions:

Why are we going for a $100$-point DFT/ $200$-oint DFT ?
And what happens when we take $10$ samples and calculate $100$-point DFT ?


texts: Difference between note based (MIDI) and sampled (FLAC, MP3, etc.) audio formats

texts:
I (somewhat) understand sampling and sampled formats, and their relation to the original (analog) signal, but do not quite relate it to note based (MIDI) formats.

What actually is a note based audio format, and is it related to the continuous signal?


texts: Scrambler generator polynomial with initial state

texts:
A length-$127$ frame scramble uses the following generator polynomial

$$G(D)= D^7+D^4+1$$

If the all-ones initial state is used, how can one obtain the $127$ bit sequence? I am not interested in the sequence itself or computer algorithm but an understanding of how to obtain in.
My understanding is that $G(D)$ is the $\mathcal Z$-transform of the impulse response $\textrm{1001001}$. Is this convolved with the initial state $\textrm{1111111}$?


texts: Is possible to get overshoot on bessel filter?

texts:
I tried to use bessel filter from here,
but in the case of a large dataset, I have overshoot.  Since I know a bessel filter shouldn't have overshoot, is this code wrong or am I doing something else wrong?

// Sample rate : 1e9
// Cut off Frequency : 50e6

int s=50000;
double[] sample = new double[s];

for(int i=s/2; i<s; i++) {
  sample[i] = 1.0;
}

for (int i = 0; i<sample.length; i++) {
    xv[0] = xv[1];
    xv[1] = xv[2];
    xv[2] = xv[3];
    xv[3] = sample[i] / GAIN;
    yv[0] = yv[1];
    yv[1] = yv[2];
    yv[2] = yv[3];
    yv[3] = (xv[0] + xv[3]) + 3 * (xv[1] + xv[2])
          + (  0.3402988787 * yv[0])
          + ( -1.4152725242 * yv[1])
          + (  2.0223552191 * yv[2]);
    filteredValue[i] = yv[3];
}

All coefficients have been calculated based on source on given website, it might been messy because its used for chebyshev and butterworth filters as well.


texts: To find the filter Co-efficients of the following equation

texts:
Given $y[n]=h_1[n]x[n]+h_2[n]x[n-1]+h_3[n]x[n-2]$ is an LTI system with unity gain at $\omega =0$ and zero gain at $\omega =\pi$. $h[n]\neq0$ .Also given that the system has a linear phase. Compute

$h_1[n]$

$h_2[n]$

$h_3[n]$

How do we approach a question like this? Any help is appreciated. I want to confirm my working for $h_1[n]$ and I found other two co-eficients as 1/4


texts:
I will try to explain the issue I am having as clearly as possible without going into my coding or maths. I have my own and a MATLAB Central implementation pf standard LMS in MATLAB. Fixed step size. No normalization or other stuff.

I am trying to use it in a system identification setup. I generate a vector of gaussian numbers using "randn" and give the same vector as input and desired response to the LMS filter. Now the estimated weight vector at the end should be a "delta" channel and this is what I get. Then i tried upsampling and interpolating the input vector by an integer number and repeating the same thing. This time around the estimated channel is of the shape of an "Sinc". I gave the interpolated signal as the input and the desired response as before. No changes.

Then i also tried low pass filtering the input vector and repeating the same thing. Again a "Sinc". Has anyone observed this before or know something about this? Please point out my mistake. Any suggestions or a discussion is also welcome.


texts:
I am working on a research project that involves machine vision. The camera we are using implements infinite focus - I have been informed that this can affect the accuracy of computer vision algorithms, why is this?

At the moment we are implementing ORB for feature matching, out of a total of 175 possible detection events 10 of those appear to be missed due to the object not being clearly focused - but it was my understanding that the point of infinity focus was that everything between the lens and "infinity" would be in acceptable focus?

Is there any other effect of infinity focus that could account for this?


texts: Detection of sharp peaks in an audio signal

texts:
I have an audio signal and I'm interested to detect the very sharp peaks.

If I zoom, here is something that should NOT be detected (this is voice actually):

NO GOOD

Here is something that should be detected:

GOOD

Ideally, a CNN with some training would be the best solution but I'm too limited in terms of computation to run it.

So, I'm looking for an easy solution with a simple signal processing algorithm (filters and others things).

I have already developed a simple algorithm based on the maximum of a 10ms window and if I see that the maximum is low, then suddenly very high, and then low again, I have a detection.

But it's not outstanding. Any better idea? Is there any filter that can find me "sharp" peaks?


texts: Does "keying on" a sine wave at a zero-crossing reduce its bandwidth?

texts:
I understand that a pure sine wave of infinite duration occupies no bandwidth, i.e. it is only the modulation of a carrier that gives it sidebands. Does the exact timing of a sudden modulation make any difference?

For simple on-off keying of a signal, it looks like https://dsp.stackexchange.com/a/24604/18819 is giving an equation to determine the relative power away from a carrier:

  The spectrum of your windowed sinusoid is just a shifted sinc function

…and the magnitude of this function is based only on the length of the windowed signal. In all discussions I've seen (e.g. CW bandwidth described) they discuss things like keying envelopes and such to reduce the splattering of significant power away from the intended carrier frequency. They don't discuss the precise timing of the envelope.

I'm wondering: does it make any difference at which phase of its cycle I "key" a sine wave on or off?

The Wikipedia article on Zero-crossing circuitry explains:

  …the switching device will "wait" to switch on until the output AC wave reaches its next zero point. This is useful when sudden turn-on in the middle of a sine-wave half cycle could cause undesirable effects like high frequency spikes for which the circuit or the environment is not expected to handle gracefully

Is this just a practical concern (i.e. non-ideal components in a real-world circuit) or does the spectrum actually change if I make a "chopped-off sinewave" from 0º to 360º, vs. a section from 90º to 450º? What about from 0º to 180º vs. 90º to 270º?! [Update: to be clearer, maybe I'm really meaning in each case e.g. "from 90º to (360n+270)º" for some relatively large n so that the signal lasts for a bit between start/end.]

In both of those pairings, the signal which starts and ends at 0 magnitude certainly seems "cleaner" than a signal suddenly starting like in the last example at +1 and ending suddenly at -1. But can this difference be demonstrated mathematically? Each pair starts/ends the sine wave "instantaneously" and they both keep it running for the same duration, so are they equivalent as far as "splatter"?


texts: Effect of delayed feedback on sinusoid of frequency corresponding to delay

texts:
Question: What is the effect of a delayed feedback path with nonunity gain G on a sinusoid of frequency corresponding to the delay? Plot the effective gain as a function of G.
I think this will amplify successive periods of the sinusoid, with it becoming unstable and growing to infinity. Does that sound correct?
I'm a bit confused by this topic so I wanted to check my understanding. Id really appreciate any help, thanks!


texts: Introduction to IP : Laplacian of Gaussian?

texts:
I am very new to the concept of computer vision (and image processing), and trying to understand the algorithm used for edge detection.
One thing I'm currently struggling to figure out is the Laplacian of Gaussian

In this case, how to you determine the value of x and y? I thought the centre of the kernel was the origin $((x,y) = (0,0))$, but it doesn't seems like the right number.

Also, if there are any resources that you would recommend to go through, I would really appreciate them.


texts: Carrier frequency offset in Bell 103 FSK system


texts: How to calculate MFCCs over a narrow frequency range?

texts:
I have a bunch of brief (~1 second each) wave files, some of which contain a frequency-modulated sound of interest between about 3900-4500 Hz. I thought I might run MFCC calculations on these sound files and use the results to pursue clustering/separation between files that contain the sound of interest and files that do not.

Since I'm not interested in the other frequency bands, I limited the calculation bounds to the aforementioned range. However, my MFCC matrix outputs as a bunch of NaNs, presumably because the range is so narrow. This either means that MFCCs are an inappropriate measure in general for such a narrow frequency range, or that I have yet to take advantage of the numerous other parameters involved in this calculation (e.g. window size, DCT type, etc.). What might be going on here? It could be that I should be investigating other acoustic features for this purpose instead of MFCCs, but I am a total audio rookie and don't know where to start.

(I'm only looking for a general/big picture answer to this question, but in case it helps provide context, I'm using R's melfcc() function to calculate these. I believe it is based on the same code as that for Matlab.)

EDIT: For more background.

I have a bunch of "detections" of an animal sound event from real field recordings, detected via a spectrogram cross correlation template. Some of these detections are true positives, some are false positives. I want to find acoustic features that might help me predict which are true and which are false. (In addition to the acoustic features, I can use other things such as time of day detected, etc.) Ultimately pursuing a Bayesian system in which the model can learn over time as new detection data are incorporated. Not attached to any acoustic features in particular, but not sure what to try and MFCCs seemed like somewhere to start.


texts:
I have a PDM data input from the MEMS microphone on the Pynq-Z1 development board. My eventual goal is to take the FFT of the audio samples and display the frequency bins on some LED.
I am struggling to understand what exactly is needed to convert the PDM signal to an acceptable input for the FFT. I have seen some videos explaining converting the PDM to PCM by applying a low pass FIR and then decimating the sampling rate.
Is this needed for my hobby project? Can I just average the PDM samples ( 0 to 1 ) over chunks of time T, to give a really simple idea of the amplitude at that time, and then feed these samples to the FFT?
How much do I need to process my PDM? I am very weak in the area of DSP.
Any help much appreciated.


texts: On what it means for a system to be minimum phase

texts: From my undestanding I get that when a system's poles and zeros are all inside the unit circle then it means that it's minimum phase. But I don't get how the location of zeros and poles are related to the phase being "minimum" or whatever the "minimum phase" notation implies. So basically I'm asking what does it mean for a system to be minimum phase othen than the zeros and poles part and why was the minimum phase as a name was chosen for this kind of systems.


texts:
If there is a function $H(e^{j\omega})$. Then will its conjugate be $H(e^{-j\omega})$?Why?
Let there be a function
$$H(e^{j\omega}) = \frac{1+ae^{-j\omega}}{1+\alpha e^{-j\omega}+\beta e^{-j2\omega}}$$
Then will its conjugate be:
$$H^*(e^{j\omega}) = \frac{1+ae^{+j\omega}}{1+\alpha e^{+j\omega}+\beta e^{+j2\omega}}$$
Where $j$ is an imaginary number equal to $\sqrt {-1}$.
How is it valid for the general case?


texts: K-Path sampling overall transfer function

texts:
I'm trying to derive the overall Z-transform for the K-path sampling system shown below. I numbered some of the equations that I'll reference.
I don't think I understand going from equation 3 to equation 4. I understand that $\frac{V_{o,i}(z)}{V_{in,i}(z)} = H(z)$, but why is $\frac{V_{o,i}(z^{1/k})}{V_{in,i}(z^{1/k})} = H(z)$? Does this follow from equation 1?


texts: LMS adaptive filter noise suppression- question about my implementation

texts:
I am writing LMS filter to suppress noise in wav file (I know there are many modules to do this but I need to write LMS manually now as I will translate it into C later).

According to this answer[1], the inputs will be the noisy voice and a shifted version of it
here is my python code:

import numpy as np
from scipy.io import wavfile

#Reading wav
fs, data = wavfile.read('te.wav')
#d= vector of first channel samples
d = np.transpose(data)[0]
print(data.shape)
#delay= 2 seconds
xd= np.roll(d,2*fs)

M=5
L=d.size
w=np.zeros(M)
y=np.zeros(L-M)
e=np.zeros(L-M)
meu=0.1

for i in range(0,L-M):
    xPart=xd[i:i+M]
    #print(xPart.shape)
    y[i]=xPart.dot(w)
    e[i]=d[i]-y[i]
    w = w+ meu*e[i]*xPart

print(w)

now, the final value if filter is [nan,nan,...,nan] and a lot of overflows happens.

I don't know what is wrong.

is this implementation right?

[1] Noise removal using adaptive noise cancellation algorithms in real time systems


texts: How to detect if the given signal is Data or Clock signal type?

texts:
I have the edge information of the signal. I need to find if it's a Clock or Data type signal without iterating through all the points in edge vector...
Please provide your valuable inputs


texts: Question about eigendecomposition, signal subspace and their properties

texts:
Lately, I am readig a paper titled
A Subspace Method for Estimating Sensor Gains and Phases.

In it, it is mentioned:

There are $m$ sensors in the array, $n$ known  narrowband far-field signals($m \gt n$, equal power). $R$ is covariance matrix of received signal, $\Gamma \in \mathbb{C}^{m \times m}$ is the diagonal matrix of unknown  sensor gains and phases, which this paper tried to solve. $A\in \mathbb{C}^{m \times n}$ is the steering matrix. $E_s$ are eigenvectors associated with principal eigenvalues. $^\dagger$ represents conjugate transpose.

It's easy to know $E_s \in \mathbb{C}^{m \times n}$ and $rank(E_s)=n.$

My first question: I can't figure out why the eq(6) holds. Did I miss some properties of the signal subspace $E_sE_s^H?$

Then the equation was transformed into eq(9),

where $D_i$ is each column of $A$(in diagonal form) and $v$ is column vector formed form diagonal elements in $\Gamma$.

My second question: Why $W_i=D_i^HE_sE_s^HD_i$ has n unity eigenvalues and m-n zero eigenvalues?(underlined in blue).

Thank for your patience to read my questions!


texts: Is There a Way to Perform a 2D Image Rotation by Matrix Multiplication?

texts:
In my understanding, unlike shifting and scaling, image rotation actually rotates the coordinates whereby interpolating the pixels at discrete positions. It is like a projection that discrete values are projected to another plane which are along with the pixel value.

Thus, I am wondering whether we could do 2-D image rotation in a matrix multiplication way which directly perform rotation on the pixel matrix of the image?

Any help is appreciated in advance.


texts:
I am interested in removing oscillations from a signal to capture the lower-frequency variations, similar to the objective of this problem. The oscillations vary in frequency in the time domain, so wavelet shrinkage seems to be a reasonable option, but most of the literature on wavelet shrinkage is applied to denoising, where the noise to be shrunk is i.i.d. Gaussian. Low-frequency oscillations are generally autocorrelated.

Is it still technically sound to apply wavelet shrinkage for removing higher frequency components even though they are not noise? Is there a better method? I am not aware of too many spatially-adaptive low-pass filters which have a convenient interpretation as wavelets.

Below are examples of two of such signals. As you can see, the oscillations occur with different frequencies along the space/time domain (x-axis). I have tried Fourier smoothing, but it does not seem to leave any relevant features. (I have also tried truncated SVD, but it also does a horrible job removing the oscillations.)


texts: How can we determine the channel impulse response using correlation process from the spectrum of the signal?

texts: I am sending the pulsed signal from the transmitter antenna, and at the receiver side, I captured the received signal in the time domain, and also in the spectrum of the signal. How can I get the Channel Impulse Response (CIR) using the correlation process?


texts: Proving Convergence of a limit related to Cross-Spectrum Estimation

texts:
Proving asymptotic covariance of Cross-Spectrum Estimation I came across this mathematical problem:

Consider two constants $M,L$ such that  $M\to \infty, L \to \infty \hbox{ and } \frac{L}{M} \to 0$, And $\ell,s,r \in \mathbb{Z}$ $\nu_1,\nu_1 \in \mathbb{R}$

$$ \lim_{M\to +\infty} \left\{\frac{1}{L}\sum_{\ell=-M}^{M} U_M(r,\ell,s) w\left(\frac{\ell+s}{L}\right)\  w\left(\frac{\ell}{L}\right) e^{-2\pi i\ell(\nu_1-\nu_2)}\right\}$$

where  $r$, $s$ are constants and:

$$ U_M(r,\ell,s)= \left\{\begin{matrix}
0 &  r<-M+\ell+s\\
1-\frac{\ell+s+r}{M}& -M+\ell+s\leq r \leq 0 \\
1-\frac{\ell+s}{M}& 0 < r \leq s\\
1-\frac{\ell+r}{M}& s<r \leq M-\ell\\
0 &  r>M-\ell
\end{matrix}\right.$$
And $w(x)$ is a function which is even, bounded,  square-integrable and such that $w(0)=1$.

It has been proven [1] that this limit exists and it is equal to  0 for $\nu_1\neq\nu_2$ and :
$$=\int_{-\infty}^{\infty}w^2(x)dx $$
for $\nu_1=\nu_2$.
I am trying to prove that replacing in the limit $U_M(r,\ell,s)$ by

$$V_M(r)= \left(1-\frac{|r|}{M}\right)$$

Produces the same result but I don't have the background to understand the mentioned proof, is there a simple way to prove this claim? I am only interested in the case of $V_M(r)$.

[1] Hannan, E. J. Multiple time series, vol. 38. John Wiley & Sons, 2009. Proof of Theorem 9 chapter V, page 314.


texts: What Kind of Features Can I Extract from a Signal

texts:
I want to monitor (automatic-)gearbox failures on some vehicles. For each vehicle I have a captured signal representing the selected gear at each one millisecond. An example of two signals are shown on the figure bellow.

I would like to compute extract some features from each signal (and represent it as a feature vector) in order to compare a specific signal to other signals (compute its distance to other signals) and see if it is deviating from most of the other signals.

Do you have any idea on how to represent this type of signals as feature vectors ? Which kind of features can we extract from those ?


texts: Best way to do accurate amplitude measurements using FFT

texts:
To do accurate amplitude measurements on an digital radar receiver, I am searching for the best method to get the amplitude out of a FFT. The signal is windowed using a Blackman window.
So far I'm only looking for the best way to reduce scalloping loss. I'm already in the frequency domain and want to find the real peak of the FFT spectrum. I already  tried parabolic interpolation, but this gives errors if the signal is near the noise level.
What is the best way to reduce scalloping loss errors without using a flattop window?


texts: Determining Toy Helicopter Orientation From Image

texts:
I am working on developing an autonomous control system for toy IR remote-controlled helicopters (like the Syma s107, for example) using a webcam and an Arduino with some IR LEDs. I am using C++ with OpenCV on a laptop running at about 2Ghz and I need to keep the system as close to real time as possible.

I am unsure of a way to effectively determine the rotation of the helicopter in the 2D image (more precisely its yaw with respect to the camera image plane). This information is important to being able to stabilize the helicopter in the screen because otherwise it floats out of view.

I have considered, and at least partially tried to determine the location of the body and the tail and use some tricks of geometry and perspective to get an estimation of shape but accurately finding the tail and body with low enough noise proved difficult. I have also considered using colored markers of some sort on certain spots of the helicopter but I'm not sure how to get a more accurate estimation than approximately left and approximately right.


texts: Is there a faster algorithm about this type of FFT

texts:
my problem is:

A real sequence $C$, the length is  $N$ is multiple of 32, the pattern is as below:

$$C =\left(a_0,\, a_1,\, \ldots,\, a_{\frac N2-1},\,\, b_0,\, b_1,\,\ldots,\,  b_{\frac N2 -1}\right)$$

the other two sequence is $A$, $B$, length is also  $N$, as below:

$$\begin{align}
A &=(a_0,& a_1,& \ldots,& a_{\frac N2-1},&&0, &&\ldots&0&)\\
B &=(0,&& \ldots,& 0,& b_0,& b_1,&\ldots,&& b_{\frac N2-1}&)
\end{align}$$

you can see, $C= A+B$.

the DFT of sequence $C$ is known, but sequences $A$, $B$ and $C$ are all unknown.

I just want to know the DFT of sequence $A$ and $B$.

I know the ordinary method is

perform a backward FFT to get sequence $C$, then
sequence $A$ and $B$ becomes known, then
perform forward FFT about $A$, the DFT of $B$ can be get by subtract DFT
of $A$ from DFT of $C$;

but the computaton is too complicated,

Is there a faster computation method?


texts: Question about direct spread spectrum in 802.15.4 at 2.4 GHz

texts:
I read the 802.15.4 standard and something is really confusing me:
How is spreading achieved in 802.15.4? is it by multiplying, encoding or modulating each data symbol (4 bits) with a certain code like in conventional DSSS or just by replacing the symbol by that code without any multiplication, encoding or modulation (which wouldn't make sense to me) ? I would think the former one but I have to say I am not sure.I guess the word "mapping" is confusing me


texts:
I'm doing some self-study for an upcoming exam and came across the following question:
My first idea to solve it was using the bilinear transform to get some approximation of $H(Z)$ (or just using the plain sampled version of the $H(s)$) then $V(Z)$ would be $H^{-1}(Z)$ to invert the effect of $H$.
Is this the correct approach? If yes, is there any other approach to this type of problem, like not using inverses?
Thanks for the help!


texts: Fast/Slow Fading: How are doppler shift and coherence time related?

texts:
In the literature I've read that fast fading happens if the bit duration is larger than the coherence time of the channel.
The coherence time of a channel is proportional to $\frac{1}{f_{Doppler}}$. So coherence time and doppler spread are related somehow. Why do frequency shifts determine the time span for which the channel coefficients are constant, e.g. is there any physical meaning of this relation? Is there any intuitive explanation?


texts: Common mode rejection (in software) without a reference channel? EEG data

texts:
Summary

I need to remove artifact that appears strongly on all channels in my EEG data. It's already recorded (from another lab) so I can't use hardware solutions. Also: band overlap and no reference channel.

Less Short

I have 28 EEG channels with strong common-mode artifact (artifact amplitude is on the order of $10^4$, the rest is on the order of $10^2$), but I don't have a channel I can specifically call a reference channel. If you run cross-correlation between the channels, all pairs have a $C_{xy}>0.98$, all at 0s lag. That alone tells me it's artifact.

Is there a standard practice for removing this kind of artifact from signal? Artifact band overlaps signal band, so band-pass filters aren't enough. I thought to call one channel the reference channel and subtract it from all others, but then I either have to manually pick a ref channel for each file (many files), or rely on a given channel being well-behaved (not all are). An option I like more is to take the mean at each time step, and subtract it from each channel. In Matlab code, artifact_free = raw_data - mean(raw_data,2) (columns = channels, rows = time steps).

The second option implicitly assumes that non-artifact components can be characterized as random, independent processes, and could smooth/remove cortical response in the signal that happens at/near the same time on different channels. Because of this I'm still a bit uncomfortable with doing that. I'm a little new to EEG so I don't know what assumptions I'm allowed to make. We got the data from another lab, so there are no EEG experts to ask here, and I don't want to lose information in the data or do something that statistics says I can't.


texts:
Two 1st order filters :

--[ b0, b1, a0, a1]
1 [ -1.40374673978609e+008 1.40374675978609e+008 1 1.000000235752411 ]
2 [ 2.22044577169459e-016 2.22044632680604e-016 1 -1 ]

gives these responses in Octave:

When using those same coefficients (in parallel order or even just one set of them) in another software I get different results. Example:

Magnitude response isn't a problem (unless not 'flat' in range 20Hz-20kHz) but the phase response is 180° even when implement only one of those filters. Shouldn't phase be 90° as it is in Octave plot.

Q1: is it just because of the transfer function (1st order (Octave) vs biquad (other software)) or is there something else beind this difference?
Q2: is it possible to plot these two filters as parallel system in Octave/MatLab


texts: kernel to calculate second order partial derivative of digital image

texts:
im working on image stacks, and I need to calculate second order partial derivatiatives of it.
I already know how to calculate derivative on x and y axis, using coefficients calculator: https://web.media.mit.edu/~crtaylor/calculator.html
So for example to calculate five point second order derivative on x axis we have formula like:

So I already know how to calculate derivatives on x and y axes, but I also need to get formulas how to calculate first and second order partial derivatives for f'xy and f''xy. I know that I could simply calculate derivatives on x axis first, then calculate from it on y axis, but I would like to obtain simplified formula that uses x and y pixels in image to calculate f'xy/f''xy.
Could anyone explain me how to obtain them?
Update:
I found somewhere on the web the formula for second order f''xy derivative for images that looks like that:
(inX[2]-1inX[0]+inY[2]-1inY[0])/4;
Would like also to get an explanation whether its correct, and how its acquired


texts:
Basically the same as this question, but it was never really answered: Stereo sound separation into three sources

Imagine I have a really trivial signal:

Left: 100Hz tone + 200Hz tone + 500Hz tone
Right: 500Hz tone + 1kHz tone + 2kHz tone

I'd like to perform some operation where I can decompose Left and Right into L', R' and C. Where:

L': 100Hz + 200Hz
R': 1kHz + 2kHz
C : 500Hz

I'd like the algorithm to work reasonably well for mixed, commercial music, which would exclude just a simple FFT analysis (I think.)

I started out looking at correlation, but I don't think that applies in this case. Now I'm thinking I need to be looking at ICA, but that seems to be focused on producing N signals from a single input, and not 3 signals from 2 inputs...


texts:
I'm pretty new to signal processing. My data is the $(x,y,z)$ acceleration of someone walking with a smartphone in his/her pocket.

Goal

Given two signals, determine if it's from the same person twice, or if it's from two separate people.
Have some idea of the degree of confidence in the decision from 1.

Attempt

Segmented the data into the cyclic portions (each step and retraction of foot), and acyclic portions (maybe waiting between steps or when the user stops to talk to someone).
Calculate the statistics of the cyclic portions, and acyclic portions (mean, s.dev, median, cross correlation, time between each step and such).

Having said that, I lack the base knowledge for determining if two signals are 'similar' to one another which I'd imagine comes from some distance function. I've found ResearchGate thread but I was wondering if there's anything else that I should include (especially since my goals are not the same as that users). The methods they mention are:

cross-correlation
covariance
mutual-information
autocorrelation

My background is mostly stats / ML / software so I'd really appreciate it if any explanations were dumbed down!