texts:
I would like to convert a signal to frequency domain. The desired frequency range is 0.1 Hz to 1 Hz and the frequency resolution is 0.01 Hz.

With the sampling rate of 30 Hz, FFT gives the frequency components up to 15 Hz.
Raising the sampling rate gives better frequency resolution. However, FFT gives wider frequency range. In my case, I just want 0.1 Hz to 1 Hz, FFT gives up to 15 Hz ( Extra computation ).

My question is, is there anyway standard way I can compute a frequency domain of a signal with specific frequency range and high resolution?


texts: Linear Predictive Coding - Meaning of spectrally Flat

texts:
I am a student with very little background on signal processing and am studying the Linear Predictive Coding algorithm. I came across the term spectrally flat in this article,
https://ccrma.stanford.edu/~hskim08/lpc/ and am not sure what it means. I know that spectral is talking about frequency.

  There are two possible signals for the source: an impulse train or
  random white noise. These signals model pitched sounds and
  plosive/fricatives respectively. The common characteristic for both
  impulse train and white noise is that they are spectrally flat; all
  spectral information is modeled in the filter.

So my question is:

1) what does spectrally flat mean ?

2) why does an impulse train have a flat spectral ?


texts: I have QA400 audio analyzer. I can export spectrum data to .csv and read it into Excel. However, the frequency scale of the data is linear. Meaning the values are every 2.9Hz and not a logarithmic scale. And the values are in dB. Is this data suitable for an AVERAGE(signal)/STDEV(noise) type of calculation?


texts: Conceptual Question on equalization technique in rayleigh fading channel based on a paper

texts:
Question   Link http://www.raymaps.com/index.php/theoretical-ber-of-m-qam-in-rayleigh-fading/

gives theoretical expressions for BER in Rayleigh fading channel. Can I  use the expression for 64-QAM in this paper? The Authors have given a plot of the BER performance but there is no expression for it. So, I am unsure how to get the plot for Rayleigh case.


texts: Pure Imaginary Poles (Why is it problematic?)

texts:
Consider the LCCDE :
\begin{equation}
\sum_{k=0}^{N}\alpha_{k}\frac{d^{k}f(t)}{dt^{k}}=\sum_{m=0}^{M}\beta_{m}\frac{d^{k}g(t)}{dt^{k}}
\end{equation}
Taking the Fourier transform on both sides, we get :
\begin{equation}
\sum_{k=0}^{N}\alpha_{k}(2j\pi\lambda)^{k}\widehat{f}(\lambda)=\sum_{m=0}^{M}\beta_{m}(2j\pi\lambda)^{m}\widehat{g}(\lambda)
\tag{1}\end{equation}
Consider the two polynomials :
$$
P(x):=\sum_{k=0}^{N}\alpha_{k}x^{k}\qquad\text{and}\qquad Q(x):=\sum_{m=0}^{M}\beta_{m}x^{m}
$$
Then since $\displaystyle\frac{P(x)}{Q(x)}$ has no poles then $\displaystyle\frac{P(2j\pi\lambda)}{Q(2j\pi\lambda)}$ has no poles for real $\lambda$ and thus $(1)$ becomes :
\begin{equation}
\widehat{g}(\lambda)=\frac{P(2j\pi\lambda)}{Q(2j\pi\lambda)}\widehat{f}(\lambda)
\end{equation}
The impulse response $h=\mathcal{F}^{-1}\{H\}$ is computed by decomposing $H$ into partial fractions. The poles $\displaystyle\frac{P}{Q}$ are assumed to lie off the imaginary axis. There are thus two cases to consider :

($\frac{P}{Q}$ has only simple poles) : In this case, $H$ can be decomposed in the form :
\begin{equation}
H(\lambda)=\sum_{m=0}^{M}\frac{\beta_{m}}{2j\pi\lambda-z_{m}}
\end{equation}
where $z_{1},z_{2},\cdots,z_{M}$ are the poles. Therefore :
\begin{equation}
h(t)=\left(\sum_{m\in \mathcal{M}_{-}}\beta_{m}e^{z_{m}t}\right)u(t)-\left(\sum_{m\in \mathcal{M}_{+}}\beta_{m}e^{z_{m}t}\right)u(-t)
\end{equation}
where we define :
\begin{align*}
&\mathcal{M}_{-}:=\{m\in\{1,2,\cdots,M\}\;|\;\Re(z_{m})<0\}\\
&\mathcal{M}_{+}:=\{m\in\{1,2,\cdots,M\}\;|\;\Re(z_{m})>0\}
\end{align*}
($\frac{P}{Q}$ has multiple poles) : In this case, let $z_{1},z_{2},\cdots,z_{p}$ the poles and let $\gamma_{1},\gamma_{2},\cdots,\gamma_{p}$ be their multiplicites. Then we can write $H$ as :
\begin{equation}
H(\lambda)=\sum_{m=1}^{p}\sum_{\gamma=1}^{\gamma_{m}}\frac{\beta_{m,\gamma}}{(2j\pi\lambda-z_{p})^{\gamma}}
\end{equation}
We can see that :
\begin{equation}
h(t)=\left(\sum_{m\in \mathcal{M}_{-}}P_{m}e^{z_{m}t}\right)u(t)-\left(\sum_{m\in \mathcal{M}_{+}}P_{m}e^{z_{m}t}\right)u(-t)
\end{equation}
where :
$$
P_{m}:=\sum_{\gamma=1}^{\gamma_{m}}\beta_{m,\gamma}\frac{t^{\gamma-1}}{(\gamma-1)!}
$$

Remark : The case where we have pure imaginary poles, can not be solved using the two cases above, for a differential equation of the form :
$$
g''+\omega^{2} g=f
$$
where $\displaystyle\frac{P(x)}{Q(x)}=\frac{1}{x^{2}+\omega^{2}}$ has two poles are on the imaginary axis.
In this case, $h$ is a sinusoid and the Fourier transform of $H$ (when $H$ is considered to be a function) is no longer defined

I didn't understand why we would be concerned in finding Fourier transform of $H$ as I didn't understand what the author meant by saying when $H$ is considered to be a function.

[Reference] : C. Gasquet, P. Witomski, Fourier Analysis and Applications: Filtering, Numerical Computations, Wavelets. Translated by R. Ryan


texts: Calculate surface of objects (rocks) in an image with lots of noise

texts:
Is there a way to caculate the size/surface of every individual rock visible in this image?
I have tried:

Contours - this doesnt seem to work the contours touch, gets real messy.
Watershed algorithm -  I couldn't get the algorithm to work in my situation.
Sharpening -> binary image -> contours   -   wasnt pretty

If anyone can direct me in the right way I'd be very thankful.
Cheers!


texts:
I am currently using MATLAB and I'm thinking if I can reconstruct PSD back to time domain signal using MATLAB's ifft. I found a link in solving this problem but it's in Phyton and when I tried it in MATLAB, I encountered an error mentioning that the dimensions didn't match. This is the code that I come up with:

%PSD to time-domain signal

%periodogram using fft
Fs = 1000;
t = 0:1/Fs:1-1/Fs;
x = cos(2*pi*100*t) + randn(size(t));

N = length(x);
xdft = fft(x);
xdft = xdft(1:N/2+1);
psdx = (1/(Fs*N)) * abs(xdft).^2;
psdx(2:end-1) = 2*psdx(2:end-1);
freq = 0:Fs/length(x):Fs/2;

figure(1)
plot(freq,10*log10(psdx))
grid on
title('Periodogram Using FFT')
xlabel('Frequency (Hz)')
ylabel('Power/Frequency (dB/Hz)')

figure(2)
plot(t,x)
grid on
title ('Signal')

%psd to signal using ifft
magnitude = N*sqrt(psdx);
phase = 2*pi*randn(1,N);
FFT = magnitude .* exp(sqrt(-1) .* phase);
signal = ifft(FFT);

figure(3)
plot(t,signal)

I calculated the PSD using the FFT but its just so that I can do it backward from PSD to FFT and then iFFT it to find the signal. This is just an example for me to compare if doing it backwards can result in the exact same signal as the original one. But once again, MATLAB said there's an error, is there anything I can change in my code? Thank you.


texts: Circular Convolution of Length L of Sequences of Length Greater Than L

texts:
I'm trying to understand how may I obtain the circular convolution of length L when the sequences I'm trying to convolve are of length greater than L.

For instance this Matlab code using sequences of length 5:

c = cconv([0,0.5,1,1,0.5],[0,0.5,1,1,0.5],4);

yields a 4 point sequence

2.25  2.5  2.25  2.0

and this Matlab code

cconv([0,0.5,1,1,0.5],[0,0.5,1,1,0.5],3)

yields a 3 point sequence

3 3 3

I know that circular convolution may be seen as linear convolution with aliasing and that if I perform the linear convolution and build overlapping periods spaced every N samples I will get the N point circular convolution but is there a way to obtain circular convolution without having to compute first linear convolution? I'm thinking about the classical way of doing convolution, where I flip one of the sequences in time and shift it and for every shift I multiply the 2 sequences and add to obtain the output sample for that shift


texts: Inverse system of a system with integral

texts:
I am trying to find the inverse system of the following (I tried finding the mathematical inverse function but since it is not the same I am not so sure) . Can someone help me find it?

$$ y(t)=\int_{t-1}^{t+1}\cos\left(\frac{\pi\tau}{8}\right)x(\tau)d\tau $$


texts:
My steps were as follows:

$\ x_2[n] = x[n-k] $

$\ y[n-k] = x[n-k] + (n-k) $

and

$\ y_2[n] = x_2[n] + n = x[n-k]+(n-k)$

Does this mean that it is indeed time invariant?


texts: Calculating Power of Sinusoidal Term and a Convolution expression

texts:
The following is an excerpt from the book Statistical Digital Signal Processing and Modelling (Monson Hayes)

  ...consider a random process consisting of a random phase sinusoid in
  white noise $$ x(n) = A\sin(n\omega_{0} + \phi) + v(n)$$ where $\phi $
  is a random variable that is uniformly distributed over the interval
  $[-\pi, \pi]$, and $v(n)$ is white noise with a variance of
  $\sigma_{v}^{2}$. The power spectrum of $x(n)$ is

  $$ P_{x}(e^{j\omega}) =  \sigma_{v}^{2} + \frac{1}{2}\pi
 A^{2}[u_{0}(\omega - \omega_{0}) + u_{0}(\omega + \omega_{0})]$$

  Therefore it follows from Eq. (8.23) that the expected value of the
  periodogram is  $$E\{{P_{per}(e^{j\omega})}\} =
 \frac{1}{2\pi}P_{x}(e^{j\omega})*W_{B}(e^{j\omega})$$ $$=
 \sigma_{v}^{2} + \frac{1}{4}A^{2}[W_{B}(e^{j(\omega - \omega_{0})}) +
 W_{B}(e^{j(\omega + \omega_{0})})]$$

I am unable to figure out how he obtained the expression for power of the sinusoidal term. Shouldn't it be just $\pi^{2}A^{2}$ multiplied by the bracket term?
Considering that $W_{B}$ represents fourier transform of Bartlett window, how is the convolution expression being evaluated here?


texts: Sampling and Reconstructing Digital Signal

texts:
Say that I have a digital signal (a bitstream actually) whose output changes every 100 mS.  I don't know exactly when it changes relative to my sampling, only that that the next bit to capture appears after 100 mS.  (I'm not capturing a square wave, but rather the signal might or might not assume a new value (either 1 or 0) after 100 mS.)  So I sample the signal every 25 mS.  How do I reproduce the bitstream from the sampled stream over some period of time...I can miss the first few bits of the capture, but after that I want to get every bit of the output?  I assume that there is a common algorithm for doing this.

By the way, the solution can all be done in software (Java / C++) and does not have to be real time...I can collect all samples and then post-process it to extract the signal.


texts: How to do continuous signal processing (i.e without windowing)?

texts:
I'm working in speech recognition research, and I wonder if there is a way to analyse sound just like how ears do (i.e. without windowing), so for example to take some feature continuously with an update for each new sample.

It is similar to talk about windowing with overlapping ratio of 99% or something like this,  you can look at the question like: How does ear working without windowing concept?


texts: How is CFi related to Code Rate and link Quality of the lte network?

texts:
Im trying to understand the relation between CFi and Code Rate and Quality of the network?
like if I have bad quality then we need to decrease CFi? what about Code Rate we need to increase?
About highy quality , if we have high quality then we need to increase CFi? what about Code Rate we also need to increase?
I need to understand the implicitly logic between CFi , Code Rate , Quality.


texts: Definitions for amplitude spectrum and phase spectrum

texts:
I want to help someone with a homework in signal processing, and the courses he provided are some slides, without clear definitions in them. I am required in solving a problem to represent the amplitude spectrum and the phase spectrum of a given signal. I searched the internet and didn't found the definitions of these two. I want to create a Matlab script for these, but if I don't know the definitions I cannot do that. Please give me the definitions for these.

  Amplitude spectrum
  Phase spectrum

If there is a Matlab command, or some other program which plots these spectrums directly, I would be very interested. Thank you.


texts: Is it possible to get the envelope of a signal via FIR filter?

texts:
I was reading an article about ultrasonic signals, and I read in it that it is possible to get the envelope of a signal by using a band pass FIR filter.
My question: Is it possible to get the envelope of a signal by passing it through a band pass FIR filter?
Thank you in advance.


texts: Analyzing a signal that contains frequency content at Fs/2 doesn't seem to work unless there is a phase shift

texts:
I am trying to write a basic program that samples a 4 kHz sinewave at a sampling rate of 8 kHz and takes the FFT of the signal and plots it.

From everything I have read, as long as the signal you are sampling has frequency content that is less than or equal to Fs/2 no aliasing will occur and the results will be accurate. However writing a simple example seems to be more complicated than I thought.

Using Python I wrote up a basic example:

import matplotlib.pyplot as plt
import numpy as np

Fs = 8000.0
Ts = 1/Fs
N = 8
t = np.arange(0, N*Ts, Ts)

# 4 kHz sinewave
y = np.sin(2*np.pi*4000*t)

# Bandwidth of the signal (Hz)
BW = Fs/2

# Spectral Lines (number of frequency samples)
SL = round(N/2 + 1)

# Frequency scale
f = np.linspace(0, BW, SL)

Y = np.fft.fft(y)*2/N
Y = Y[:SL]

fig, ax = plt.subplots(2, 1)

ax[0].stem(t, y, use_line_collection=True)
ax[0].set_xlabel('Time')
ax[0].set_ylabel('Amplitude')

ax[1].stem(f, abs(Y), use_line_collection=True)
ax[1].set_xlabel('Freq (Hz)')
ax[1].set_ylabel('|Y(freq)|')

plt.show()

Looking at the output you can see that this does not properly capture the frequency content at 4 kHz in the FFT plot.

But if I simply add a phase shift to the signal by changing this line

y = np.sin(2*np.pi*4000*t)

to

y = np.sin(2*np.pi*4000*t + np.pi/2)

I end up with much better results...

My question is, how come this doesn't work without a phase shift? It makes me wonder how anyone can be confident in the result of an FFT when the signal being sampled has some frequency content that is at the frequency Fs/2. How do you ensure that the signal you are analyzing is at a phase alignment that will not cause issues?


texts:
There is an implant in me, is there a way to identify the frequency it is receiving signals on?
I don't want to share the evidence and my reasoning for believing there is an implant in me, you can either take my word for it or not.
I want to find the frequency it is receiving signals on, so far I have used dvb-t dongle to use it as an SDR, and I have manually scanned the entire frequency range provided by it, which is 24MHz to 1700MHz, which was very tiring, but I couldn't identify anything suspicious, it could be possible that as I was tuning, the frequency it was receiving signals on was not the tuned one.
I want to know if there a way to identify the frequency of the signal? How? And what equipment would I need?


texts: SciPy - Distinguish between two group of periodic samples

texts:
First of all, I'm sorry for my bad English writing, plus, I'm new to DSP.

Background

We have got motion data of 20 cows. 10 cows are healthy and 10 cows are slightly lame.

  Lameness is an abnormal gait or stance of an animal that is the result of dysfunction of the locomotor system... Wikipedia

It is expected to observe a significant difference in locomotion data, recorded from these 20 cows. Data has been collected using an electronic sensor consist of Angular velocity ($\omega: rad/s$) and Linear acceleration ($a: m/s^2$). As it was expected, data is periodic:

Vectors axis: X(Red), Y(Green), Z(Blue).
Up: Angular velocity ($rad/s$) over time ($ms$).
Down: Linear acceleration ($m/s^2$) over time ($ms$).

Each period, represents a step of cow.

Question

I want to perform a comparison between these two group of data to find out the significant difference between lame and non-lame cows. My question is what is/are choice approach(es) to perform this comparison? Is there a standard test to choose the approach according to the signal data?

My best hypotheses:

Maybe some of primary data properties be useful. (e.g average, standard deviation, extremums, etc.)
Try to use Fourier transform of data. But I have no idea about this one. (Please guide me if it's possible).
Try to use derivative or integral of time series. For example, maybe the Angular acceleration ($\alpha: rad/s^2$) is preferable.

Thanks in advance.

Update

These are some other plots:

Normal:

Lame:

Lame:


texts:
I need some face similarity metric.
I know about PCA,LDA approaches that uses raw pixels data, but they are not scale invariant(I know that I can resize image but I think that's not good solution).
Maybe I need to use AAM,ASM aproaches?
But I'm interested in metric that gives me the greatest separability of faces.
At first I don't need automatic detection of metric features, for example imagine that I can mark all faces by hand.


texts: Convert fixed frequency bandwidth samples to time domain

texts: I'm trying to convert signal (bandwidth 1400 MHz, start freq 9300 MHz, stop freq 10700 MHz, step 3.5 MHz) from frequency domain to time domain. Signal data in frequency domain, as well as signal data in time domain, I got from network analyzer. So after processing data from freq to time I'm able to compare results. The problem is, that my calculation result differs from network analyzer data. You can see it on the picture below. Blue line - data from network analyzer, green line - my calculation result. Picture (a) is a signal in frequency domain, picture (b) - signal in time domain. In time domain step is 5e-10 seconds. Does anyone has any suggestions? Maybe Network analyzer freq data simply has not enough resolution to convert to time domain correctly as Network analyzer do? Thank you.


texts: This is about signal processing in the first radar

texts: I read in a book that the first radar was a CW one that was used to detect ships.  Since it was CW, did it use Doppler to detect the moving ships?  What was the signal processing used in it?  Is there any reference to this information?


texts: Any good C# library for signal processing?

texts:
Does anyone can link me to a good C# DSP library? I saw some good C++ libraries but I don't have much with C++. Is there any way to wrap them ?

My main porpuse is to apply some filters(Lowpass, Highpass,Notch....) on a a buffer. Thanks


texts:
I have a pulse signal from which I sample N times of level changes (e.g. high->low).

At undefined times the pulses in the original signal are completely missing. This leads to wrong number of measured original samples (N+m, m: count of lost samples).

I have implemented a naive detection algorithm:

prev_time = x[n-1] - x[n-2]
act_time = x[n] - x[n-1]

if (act_time / prev_time > 1.7)
   missing_sample_detected()

My questions are:

Is this the way to go?
What alternative algorithms exists for detecting the position of missing samples?
Can you suggest some literature on this topic? Atm i'm looking at "nonuniform sampling" but not sure if it's the right place to look for this problem


texts: changing angular data to remove the sharp changes

texts:
I have a 200 by 200 matrice named theta which shows an angle in a 200 by 200 box. The angle is in the interval [-90,90]. When I plot theta in a 2d plane, there are some positions in which the angle jumps from -90 to 90. This is shown for a particular choice case in the below picture:

As it is clear from the picture, there are positions where theta jumps from -80 to 80. I want to make theta even by adding (or subtracting) 180 to it in the positions with sharp change. The reason that I can only add (or subtract) 180 is that in the problem that I am trying to solve, has a symmetry which allows adding 180 degrees to the data. I appreciate it if someone could solve this problem.

The script that I use to plot it is:

[a, b] = contourf(theta, 88);
    set(b,'EdgeColor','none');
    colormap(summer);
    shading flat;
    colorbar;

Using the proposed answer I get the following:


texts: How can i center the optical mark image?

texts: I want to recognize optical mark using image processing algorithms. There is a wide variety of optical paper and i want to recognize all off them. For example; If i create a template I can superimpose on other papers and i can analyze specific region of paper. But some paper can has a noise or is not true location. So i can not analyze properly. Fortunately, all aptical paper have reference point  on the left side of paper. If i detect slope of the line  i can rotate image. How can i detect slope of this line?


texts: How to remove color cast from HSV information

texts:
I have hue, saturation and value of a color (HSV color-space). The color has to be set on a device that displays them incorrectly. If I specify white it displays light magenta. However, if you specify some green it displays the best white it can (let's say: gray). How do I remove this color cast? Actually: How do I create a color cast in the HSV numbers to compensate for the wrong display?

My approach was the following. But it lead to a skip of some magenta colors, when I ran through the whole rainbow with a saturation of, say, 0.8 (interval 0 to 1):

Shift magenta to the beginning of the hue scale (60 degrees forward) and thus the hue of the current color
Calculate the distance to move in the direction of green. With a saturation of 1 that means to move completely to green (180 degrees).
This is the formula: distance = (180 / 360 - shifted_hue) * (1 - saturation)
Then add the distance to the shifted hue (possibly resulting in a subtraction).
Shift the hue scale back by 60 degrees.

As said, this is leading to an ugly skip of some magenta colors, because the lower the saturation the bigger the gap at magenta.

Do you know of a better algorithm?


texts: How to extract IF (instantaneous frequency) from Discrete Hilbert Transform?

texts:
The continuous time Hilbert transform is
$$\hat x(t) := x(t) + j\left( p.v. \left\{\frac{1}{t\pi} \ast x \right\} (t)\right)$$

where
$$ \theta(t) = \tan^{-1}\left( \frac{ p.v.  \left\{\frac{1}{t\pi} \ast x \right\} (t)}{x(t)} \right)$$
and
$$
         \omega(t) = \theta'(t)
$$

and since $\theta(t)$ is smooth, you can actually calculate the instantaneous frequency. But in the discrete time domain, the angle function is discrete, so given that in the dt domain, your hilbert transform filter is

$$ h_{HT}[n] = \left\{
      \begin{array}{ll}
       \frac{1}{n\pi}  & \mbox{if}\ \  n \neq 0 \\
        0               & \mbox{otherwise} \\
      \end{array}
     \right.$$

How do you get the approximate frequency? or are you really just getting $\Delta\theta[n]$? Sorry if this is me just getting hung up on something trivial, but most references don't seem to clearly address this.

$$\theta[n] = \tan^{-1}\left(\frac{(h_{HT} \ast x)[n]}{x[n]}\right)$$
$$\omega[n] = \left\{
       \begin{array}{ll}
        \theta[n] \ast \frac{1}{T_s}(\delta[n] - \delta[n-1])  & ? \\
        \theta[n] \ast \frac{1}{2T_s}(\delta[n+1] - \delta[n-1])  & ? \\
        ???
       \end{array}
      \right.
$$

I'm looking for what is typically done. The "Standard" approach.


texts: VOFDM (Vector OFDM) advantages and disadvantages

texts:
What are the advantages and disadvantages of using VOFDM over OFDM?
I know that one advantage is frequency diversity, what are others?

edit : By VOFDM I mean Xia's method as shown here: arxiv.org/pdf/1507.06833.pdf


texts: Why does upsampling in the frequency domain produces replicas of the signal in spatial/time domain

texts:
The experiment is the following:
Given a 1d signal, e.g., a vector of values $f$. Let $F$ be its DFT, i.e., $F=fftshift(fft(f))$, shift is just to have DC centered. Then we upsample $F$ as $uF=upsample(F,2)$. Note that we do NOT interpolate, juste upsample. Like @Fat32 mentioned,  signal expander, just stuff with 0s.
Now if we look at the $ifft(uF)$ or $abs(ifft(uF))$ , - let us disregard problems of even/odd nb of values? -, what we see is that the temporal or spatial signal $f$ is duplicated. Of course, the size of the signal is doubled but that doesn't intuitively imply that the signal will appear 2 times in the other domain. Although,  for a pure sine wave, for the example at 1 Hz i.e. 1 cycle only over the vector, stuffing zeros in between in the DFT will have the effect of just "moving" the peaks further apart therefore resulting in higher frequency. For such a simple sinusoid, 2 waves appear in the temporal domain instead of 1, for the non-upsampled one.
I m looking for an intuition explanation of why that is and also a mathematical one (such as Like the fact that sampling is modeled by a multiplication by a dirac comb and signal trucation multiplication by a square function. )


texts: Why does my I/Q data from radar are not centered?

texts:
I am working on the IQ raw data from FMCW radar. I plot the I and Q data, they seem to be strongly shifted from the center. And the amplitude of I and Q also varies. I don't understand why it looks like this. I think, they should local on the center and with fixed amplitude.
Thank you very much if someone can help.


texts: Does this Signal Smoothing algorithm have a name?

texts:
We are reverse engineering some 20 year old software.  Original developers were laid off years ago, and cannot be found.

In this code, there is a signal that is getting smoothed as follows:

$P_{new} = P_{old} + P_{\Delta} \frac{H + (I-H) P_{\Delta}^2}{J^2 +
    P_{\Delta}^2}$
$P_\Delta = P_{newest Observation} - P_{old}$
$H$ is commented in the code as, Quiescent Smoothing.  It is a hardcoded constant, $H > 0$.
$I$ is commented in the code as Step Smoothing.  It is a hardcoded constant.  $I > 0$.
$J$ is commented as Noise Threshold.  It is a hardcoded constant.  $J > 0$.

I am interested in the name of this algorithm.

I was asked, as I've done a lot of work in motion tracking, but this is clearly not a Kalman filter, or any of it's variants.


texts: What does it mean for audio to be 'sped up'? How can I undo it?

texts:
I very simply have a .wav audio file, but there is a note with it that says "This audio has been sped up by 10x".

I am wondering, what does it mean exactly from a signal processing perspective for an audio signal to be 'sped up' by some factor, and secondly, how can I undo this? Is it possible?


texts: Designing a Notch filter for Digital Audio to be able to work with all audio sampling frequencies

texts:
I am currently designing an FIR notch filter using Matlab Filter Design & Analysis tool. I created a notch filter at desired notch frequency (lets say f0) with sampling frequency of 44.1kHz. But I found that the same notch filter is not able to filter-out/attenuate the desired frequency in other audio signals with different sampling rates.

Is it possible to design a single notch filter that works for all audio sampling frequencies.

FYI, I have tried with designing a notch filter with highest sampling frequency, but it is not working for audio with sampling rate other than what it is designed for?

Can somebody help me/provide me a lead in designing such a notch filter?


texts: Recover signal from its spectral amplitude and envelope

texts:
I am given an amplitude spectrum (no phase) and the envelope of a signal. What I know about the original signal is, that it can be thought of as wavepacket like structure (sinusoids under a bell curve) and the spectrum is narrow banded.
To be able to further analyse the original signal I would like to recover the input signal from those two given functions.

My questions are: Can I recover the signal from its amplitude spectrum and envelope or would you advice me to do otherwise.

To clarify what is given:

The signal is thought of wavepacket structure, which is

$$x(t) \approx \sum_n\frac{1}{\sigma_n\sqrt{2\pi}}e^{-\dfrac{1}{2}\left(\dfrac{x-\mu_n}{\sigma_n}\right)^2} \cdot \sin(2\pi f_n x)$$

with $n \gt 1$, $\lvert\mu_k-\mu_l\rvert \lt \sigma_k, \sigma_l$ and if $\mu_k \gt \mu_l$ then $f_k \lt f_l$.

The amplitude spectrum is the absolute of the Fourier transform of the signal, which is

$$a(\omega) = \lvert\mathcal{F}\{x(t)\}\rvert$$

The envelope can be thought of as absolute value of the analytic signal, which is

$$e(t) = \lvert x(t) + j \cdot \mathcal{H}\{x(t)\}\rvert$$

I'm not sure if it is possible or even that beneficial to recover the signal and I am pleased for any answer or every hint.


texts: Filter design with a phase delay specification?

texts: Given a desired filter magnitude response, plus acceptable linear phase and minimum phase FIR filter approximations, how can one design a filter with the given response and a delay specification of some value between minimum phase and linear phase?


texts: Python toolboxes for state-space estimation via subspace estimation

texts:
Is there (open-source) toolboxes for state-space estimation via subspace estimation in Python?
I know this is used in Matlab's n4sid function, but I didn't found any Python's implementation (even in Scipy's signal module or in Python Control Systems Library).
It would really helps not to have to code it :)


texts: How make FFT when buffer size is not 2^L

texts:
I still try to understand FFT :)
I know I can do something like that:

float bufferSize = 500.0f;
int correction = log2(bufferSize);
bufferSize= pow(2, correction);

But then I get buffer size 256. So it doesn't use all samples in the buffer. But I've heard there are some methods to make FFT with buffer size for example 500. And use all possible samples.
Could anyone explain me how to do that?
Great thanks in advance.

So I need to develop my question :)

I’ve just read Rabiner, Lawrence R., and Bernard Gold. "Theory and application of digital signal processing."  Of course not all but the fragment titled “A Unified Approach to the FFT”.

And there is about dividing N-point sequence to make matrix. I even implemented in C++ exact example from that book with N=60 points of sequence. But I am not sure if I understand the idea (maybe it’s because English is not my first language).

Firstly in the book they say to make matrix 60=5 X 12, and further they say to pay attention that we can divide each 12 points to make matrix 3 X 4. But although it is said, the further calculations are only for 5 X 12. Why not 5 X 3 X 4?
Is it only for make explanations easier? Or what?

And more important question is what exactly that matrix division give me?
Stanley Pawlukiewicz says about my example (when N=500) to make prime factors 2 2 5 5 5. So as I understand it’s 5 dimensional matrix, 2 X 2 X 5 X 5 X 5? Am I right?

But to make DFTs on that matrix I still need to make 500x500=250000 calculations, so it’s like regular DFT, not any FFT. I could imagine I can make 125 X 4 points FFTs (4 is 2 to the power of 2). But if it’s the idea, why we are not talking about matrix 125 X 4, but instead we are talking about matrix 2 X 2 X 5 X 5 X 5?

In which point here is FFT?


texts: Setting some values in a vector to have specific values after multiplying with such matrix

texts: Assume I have a known matrix $X$ of size, for example, $(16$ x $16)$, and a vector $z$ of size $(1$ x $16)$ where only some equispaced values are known, for example $1:4:16$  or values in locations $(1,5,9,13)$ in $z$ are known and others values are unknown. If we have $y = z*X$;  I need to set the known values in $z$ which are located in $(1,5,9,13)$ to such numbers such that to have ones in the same locations in $y$. Is there any algorithm or method I can use to do that ? Is that possible?


texts:
Does baseband signal has negative frequency? In wiki baseband signal means that can include frequencies that are very near zero. I wonder whether baseband signal has negative frequency.
Thank your answers..


texts:
I want to remove the background from image. Let's say I have this background:

.

Then I put pen drive and tippex on it.

.

Is it possible to remove the background image from second image? If so, then how can I do it?

I'm using the AForge.NET Framework.

UPDATE

I want to remove background like in this research paper. Is there any library for this kind of work?.


texts: FFT method input argument have to be $2^n$ ?

texts:
Does FFT method input argument have to be power of 2, i.e, $2^n$
I just realized there are many algorithm for FFT implementation, is there any algorithm that takes arbitrary amount of samples as input argument?
if yes, what is their advantages amongst each other?
namely, what algorithm does Matlab apply?


texts: Implementing Frequency Domain Convolution in MATLAB (Convolution Theorem)

texts:
I'm trying to prove convolution in time domain is same as multiplication in frequency domain but I'm not getting the same answer in matlab.

Here is the code:


texts: Calculating the 3dB frequency of an nth order low pass filter and nth order high pass filter

texts:
I am using the 6th order high pass filter in the C code. And the cut-off frequency selected for it is 150 Hz and the sampling frequency being used is 32000Hz. Now, I want to calculate the 3 dB frequency for this implementation (theoretically). I have read that the 3 dB frequency is the frequency at which the filter magnitude response is $1 / \sqrt{2}$ of the peak amplitude response. But I am not sure about how to calculate it? And also, I want to know how to calculate 3 dB frequency for an nth order low pass filter.
Note:
I am using the Chebyshev type II design in my code to implement a 6th order high pass filter.


texts: Find Magnitude Responce at $\omega=\dfrac{\pi}{2M}$ where $M$ is the number of channel in QMF

texts:
I have frequency response of low pass filter

    M=8  %%%channel
    x=8*512
    d1=fir1(N-1,wc/pi,w);
    % L=length(d1);
    % for k=1:L
    %     b2(k)=((-1)^k)*d1(k);
    % end
    %%%%%%Frequency response
    h1=fft(d1,x);
    a1=max(abs(h1));
    m1=20*log10(abs(h1/ a1));
    c=0:x-1
    plot(f1/x,m1)

I have to find magnitude responce at $\omega=\dfrac{\pi}{2M}$ i.e., $h_1$ at $\omega=\dfrac{\pi}{2M}$


texts: How to determine whether a filter is high/low or band pass from the Z transform?

texts:
How to solve questions of these kind?

I have tried by replacing $z=re^{jw}$ and taking the limits from $0$ to $\infty$. But I am not sure what $e^{j\infty}$ is.


texts: Meaning of AWGN complex and real noise under BPSK Decision Scheme

texts:
I'm currently studying error correcting codes and decided to replicate some common Bit Error Rate curves under BPSK modulation.

I initially had trouble to convert SNR to a Gaussian $\sigma$ because I was confused why people used diffent $\sigma$ if the channel was real or complex. I initially thought that I could add $\sigma$ for both IQ components. Then I understood from How do I add AWGN to an I and Q representation of a signal? that $\sigma_I = \sigma_Q = \frac{\sigma}{\sqrt(2)}$ for total noise energy consistency.

But after this information regarding how I should add noise to the received signal I don't get how this does not generate a inconsistency under the BPSK decision boundary if I interpret the channel as complex or real.
From what I understand from a given SNR, there is a relationship with the total Gaussian noise $\sigma$ that I should add.

If channel is real (only considering I component), BPSK maps bits to {-1, 1}, noise added in I component is $\sigma_0$ for SNR = 0dB.
If channel is complex (considering IQ components), BPSK maps bits to {(-1, 0), (1, 0)}, noise added for SNR = 0dB has total $\sigma = \sigma_0$, so $\sigma_I = \sigma_Q = \frac{\sigma_0}{\sqrt(2)}$.

Since BPSK should only be concerned with the real values (InPhase values) the Bit Error Rates would be clearly different in both cases.

I guess my lack of understanding must be related to the SNR to $\sigma$ mapping under a real/complex channel. I don't understand how interpreting the problem in 2 dimensions differs from 1 dimension and its relationship with $\sigma$.


texts: Correct magnitude spectra of a cosine DFT?

texts: I've just started my course on DSP and haven't laid my hands on MATLAB yet. I was wondering if the plot of the magnitude spectra was correct for the below shown $x(n)$:


texts: Conditions for symmetric and unimodal windows in both time and frequency domains

texts:
After a lecture on harmonic analysis and time/frequency methods, I reconsidered the Gaussian kernel, defined in continuous time.

It is unimodal and symmetric, and its continuous Fourier transform is another Gaussian, thus unimodal and symmetric (from Fourier transform of a Gaussian is not a Gaussian, but that's wrong!):

As a filter or a window, the Gaussian ensure a monotonic weight decay around its center. The interpretation in the frequency domain is similar: frequencies are monotonically attenuated away from a center frequency.

Such a property allows a straightforward interpretation in both the time and the frequency domain.

For continuous kernels, are there generic characterizations (necessary or sufficient conditions) under which  unimodal and symmetric windows also have a  unimodal and symmetric amplitude spectrum?


texts: Store a FFT with a minimal amount of data

texts:
I have an array x of length 1024 (stored as 16 bits integers, named for example np.int16 in numpy/python), i.e. the size of x is 1024*2 = 2048 bytes.

(Remark : x comes from an audio .wav file, stored as 16 bits integers, as it is very common. But it is also very common to interpret it as a float array, with values in $[-1, +1]$ by doing: x = x * 1.0 / 2^16)

When I take fft(x), as the input was real, there is some symmetry that makes that I only need to store half of the array fft(x), that's often also called rfft(x) : real fft.

This means that, by taking fft, I translated 1024 real numbers into 512 complex numbers (i.e. can be viewed as 1024 real numbers again) : in a mathematical point of view, we have the same amount of data :

1024 real coefficients -- rfft --> 1024 real coefficients

But in a programmaing point of view, is it possible to store, losslessly* and without compression, the fft of an array of 1024 elements of type int16 (using 2048 bytes) with 2048 bytes maximum ?

If not, what is the minimum number of bytes required to store the fft of such an array?

remark (*) : by losslessly I mean that the original x can be recovered later


texts: Method to generate binary sequences with desired cross-correlation and autocorrelation properties

texts:
I am looking for a method to generate two binary sequences of length $N$ with the following properties:

Very good cross-correlation for all shifts.
Good enough autocorrelation for all shifts except zero delay (good enough means $\gg 1$ and $\ll N$).

I can even relax the constraint on the cross-correlation as follows:

Very good cross-correlation for $\pm M$ shifts around zero delay, and no matter for the other shifts.
Good enough autocorrelation for all shifts except zero delay.

Following publications of Dr Welch and Dr Sarwate, it is possible to obtain a set of $K$ sequences of length $N$ and norm $N$ with the following properties :
$$\max(θ_a,θ_c)≥N\sqrt{\frac{K}{NK-1}}  \approx \sqrt{N},$$
and
$$\theta_c^2 + \frac{N-1}{N(K-1)}\theta_a^2 \geq N,$$
where $\theta_a$ is the maximum autocorrelation and $\theta_c$ is the maximum crosscorrelation.
From that, I understand that it is possible to find two sequences whose cross-correlation is ideal ($\theta_c = 0$) and whose autocorrelation is good enough ($\theta_a \approx \sqrt{N}$).
However, I am not aware of a method or an algorithm to generate such sequences.
Could you provide some directions or point to a paper that would help?
Besides, by limiting the constraint on the cross-correlation to some shifts only, can we expect to reduce noticeably the maximum autocorrelation? Are there methods to generate such sequences?


texts: Processing Accelerometer Vibration Data With FFT

texts:
For a project I am attempting to use an accelerometer to measure vibration in an RC aircraft and determine frequency from the result. To do this I am using an MPU-6000 accelerometer sampling @ 1000Hz. Before I actually deploy this system on an aircraft, I have taped the sensor to a speaker and used a frequency generator to generate a 100Hz tone for 30 seconds. This should be well within the accelerometer's range:

1000Hz / 2 = 500Hz maximum by Nyquist rule, much higher than 100Hz

My amplitude data in the time domain is bellow (generated w/ GNU Octave):

Zoomed in:

That looks like a ton of data to me but nothing seems to be obviously in error. Bellow is the data after performing a simple periodogram in GNU Octave with the command periodogram(DATA,[],[],1000):

A peak can be seen at 100Hz but there are all of those other spikes that I can't explain. I have tried to detrend my data using the GNU Octave command detrend(DATA,'linear') but that had no effect on removing the stray peaks.

I get the feeling that I should be doing some filtering but I am new to this and really don't know what I am doing. How can I remove all of the stray peaks in the periodogram? Thanks in advance!

Data file on Google Drive: http://goo.gl/w3Brol

EDIT:

Here is the periodogram for the unit sitting on the speaker with nothing playing for 30 seconds:

There doesn't appear to be any interference. The speaker was on, just not playing anything. This is making me think that my speaker is generating harmonics when I supply a sine wave. Could that be? As always, thanks for the help!

Silence data file on Google Drive: http://goo.gl/bNbnDA

EDIT #2:

Success! After isolating my speaker from the table, taping the device to the back of the speaker (I bet glue would help further), and lowering the volume I was able to get the result below! You guys were spot on, thanks for all your help!


texts: Train Cascade Object Detector example in MATLAB

texts:
I am trying to use the example from here to detect a stop sign.

But when I change the image to search for stop signs in there are a huge number of false positives.

Am I doing something wrong?


texts: One sided frequency spectrum (Matlab vs. Origin)

texts:
There are a lot of queries on fft frequency all over the web. I guess the following point not discussed anywhere explicitly. Hope someone can provide an insight here.

If we have and even number of data points, N=10, the fft complex output arranges the data as

fft = [c0, c1, c2, c3, c4, c-5, c-4, c-3, c-2, c-1],

where the complex numbers corresponding to positive and negative frequencies. I read somewhere that MATLAB calculates the negative coefficient first, hence we have c-5 but not c5. The author did not explain the reason.

Point no. 1, that the values are not symmetric, there is an extra c-5.

When we wish to make two-sided frequency spectrum, the frequency axis ranges from [-(N/2): (N/2)-1]*Fs/ N. Fs is the sampling rate, N is the number of even data points.

If we wish to make a one-sided positive frequency spectrum, should we choose

A) [0:(N/2)]*Fs/N and ignore the fact the we are using the values corresponding to the negative frequency axis, given that the data is a real number and it is just a mirror image.

B) [0: (N/2)-1]*Fs/N represents the true positive frequency axis?

If Fs= 250 Hz, the true positive frequency axis will end at 124.9980 Hz

If we happen to choose the negative frequency axis values and ignore the frequency sign, the frequency axis ends at 125 Hz exactly.

The same data when plotted in OriginPro ends the frequency axis at 125 Hz when plotted single sidedly.

Which approach (A) or (B) is rigorously correct, and why would OriginPro plot the frequency upto 125 Hz?


texts: Can you apply an audio filter/effect to only part of an audio signal and not get audio glitches?

texts:
I'm entertaining the idea of making a music-creating application. I'm a total newb at signal processing. The question that concerns me most right now is, if I apply a filter/effect such as convolution, echo or reverb, flanging, etc. to only a part of a song (starting at a certain time and ending at a certain time within the span of the song), will I end up with glitch artifacts in the sound where the filter comes into and goes out of effect?

Even though I don't know much about DSP, it seems like I would, unless I were a mathematical genius and knew how to eliminate them with precision. Is this an issue, and if so, what are the ways to circumvent it? Maybe one would have to apply the filter to the entire song and change some modulating variable in the filter so that it applies the effect at zero percent at the times it's not supposed to be in effect?

Thanks.


texts:
I found the answers to this question and this question to be extremely helpful in understanding the derivation of the downsampling or decimation property of the DTFT.  Thank you!  I am now struggling to come up with a good example that shows clearly the role of the frequency-shifted term(s).
To summarize, let $y[n]$ be a discrete-time signal formed by downsampling $x[n]$ by an integer factor $M$,
$$ y[n] = x[Mn]. $$
Then the discrete-time Fourier transforms of $y[n]$ and $x[n]$ are related through
$$ Y \left( e^{j \omega} \right)
= \frac{1}{M} \sum_{k=0}^{M-1} X \left( e^{j (\omega - 2 \pi k)/M} \right). $$
The simplest case is for $M=2$,
$$ Y \left( e^{j \omega} \right)
= \frac{1}{2} \, X \left( e^{j \omega/2} \right)
+ \frac{1}{2} \, X \left( e^{j (\omega/2 - \pi)} \right) . $$
I want to develop an example that clearly shows the role of the second term.  I have already derived the result for a causal exponential signal, but for that example the role of the second term is not at all obvious from a plot of the spectrum.  Therefore, let $x[n]$ be a sinc signal,
$$ x[n] = \frac{\sin(\omega_0 n)}{\pi n}
\qquad \Rightarrow \qquad X \left( e^{j \omega} \right) =
    \begin{cases}
        1, & |\omega| < \omega_0 \\
        0, & \omega_0 < |\omega| < \pi.
    \end{cases}
$$
I am suppressing the periodic repetition of the rectangular spectrum here for simplicity.
Assume for the moment that $\omega_0 < \pi/4$.
The computation of the DTFT of $y[n]$ by the downsampling property gives
$$
\begin{array}{rclcl}
    Y_1 \left( e^{j \omega} \right)
    & = & \dfrac{1}{2} \, X \left( e^{j \omega/2} \right) & = &
    \begin{cases}
        \frac{1}{2}, & |\omega| < 2 \omega_0 \\
        0, & 2 \omega_0 < |\omega| < \pi.
    \end{cases} \\
    \\
    Y_2 \left( e^{j \omega} \right)
    & = & \dfrac{1}{2} \, X \left( e^{j (\omega - 2 \pi)/2} \right) & = &
    \begin{cases}
        \frac{1}{2}, & \pi - 2 \omega_0 < |\omega| < \pi\\
        0, & |\omega| < \pi - 2 \omega_0.
    \end{cases}\\
    \\
    Y \left( e^{j \omega} \right)
    & = & Y_1 \left( e^{j \omega} \right) + Y_2 \left( e^{j \omega} \right)
    & = &
    \begin{cases}
        \frac{1}{2}, & |\omega| < 2 \omega_0 \\
        \frac{1}{2}, & \pi - 2 \omega_0 < |\omega| < \pi\\
        0, & 2 \omega_0 < |\omega| < \pi - 2 \omega_0.
    \end{cases}\\
\end{array}
$$
This expression tells us that the DTFT of $y[n]$ consists of two rectangular spectra, one centered around $\omega = 0$, and the other around $\omega = \pm \pi$.  This would seem to be exactly what I am looking for.  However, if we return to the original expression for $y[n]$,
$$ y[n] = x[2n] = \frac{\sin(2 \omega_0 n)}{2 \pi n} . $$
Therefore, the DTFT of $y[n]$ should be
$$
    Y \left( e^{j \omega} \right) =
    \begin{cases}
        \frac{1}{2}, & |\omega| < 2 \omega_0 \\
        0, & 2 \omega_0 < |\omega| < \pi,
    \end{cases}
$$
which contains only the low-frequency rectangular component.  How can I resolve this apparent contradiction?


texts: Seeking advice on how to denoise a video from poor CCTV lighting

texts: I have grainy CCTV footage that will need some amount of clean up. I request for ideas on the best way to clean out the noise. I am attaching a frame extracted from the video here for hints on the specific noise cleaning I will need. Just for context, the guy in the image robbed and brutalized a vulnerable female a couple of days back. The guy wore a COVID mask thorough out the ordeal.  In the brief spell when he put the mask off, he was in a region where lighting was too poor. Hence the image that would give us a clean shot is way too grainy.


texts:
I have a set of data over which I would like to interpolate, with a sampling rate say about $f_0$ Hz with a significant uniform random sampling jitter, such that it's more or less:

$$f_0 - \frac{1}{4}f_0 \le f_s \le f_0 + \frac{1}{4}f_0.$$

Normally, with uniform sampling, I can perform sinc interpolation:

$$x(t) = \sum\limits_{n=-\infty}^\infty x[n] \cdot \mathrm{sinc}\left(\frac{t-nT}{T}\right), \quad \text{with}\quad T = \frac{1}{f_s}$$

Can I do something similar if my sampling rate is non-uniform?


texts: variation of the source separation problem

texts:
I have four sensors which make measurements $y_k(t)$ that can be modeled as complex time series:

$y_1(t) = h_1(t) * x(t) + n_1(t)$

$y_2(t) = h_2(t) * x(t) + n_2(t)$

$y_3(t) = h_3(t) * x(t) + n_3(t)$

$y_4(t) = h_4(t) * x(t) + n_4(t)$

I am interested in extracting the $n_k(t)$ signals; the $x(t)$ is a nuisance common mode signal that I don't care about.

The $n_k(t)$ signals are uncorrelated noisy signals. $x(t)$ is band limited. Looking at the coherence between a pair of signals, it seems the $h_k(t)$ are fairly benign and can probably be treated as a scaling factor and a delay.

It looks like I can get reasonable separation of the power spectra by looking at

$S_{ii}-|S_{ij}|^2/S_{jj}$

where I computed $S_{ii}$ using matplotlib: mlab.psd(y1) and $S_{ij}$ as mlab.csd(y1,y2) etc.

However, I'd ideally like to recover the time domain $n_k(t)$ as best as I can.

Any suggestions?

Thanks,
G


texts:
Is the convolution of two equal signals the same signal?

I have this system:

and i have to find $h_1[n]$ (which i've been struggling for a while), given

$$ h_2[n] = u[n] - u[n-2] $$

and $h[n] = h_1[n] \star h_2[n] \star h_2[n]$ given by:

I can find a solution if $h_2[n] \star h_2[n] = h_2[n]$, but I don't know if that holds.


texts:
So an equalizer manipulates the gain of certain frequencies by use of a variety of filters, as we all know. But is there a way to manipulate delay in a frequency-specific manner?

A parametric equalizer

Above is a link to a picture of a parametric equalizer. What if the white line in the picture represented delay time instead of gain?

Is this possible? Does it exist? And if so, what is it called?


texts: Is there a special reason why the principal range is defined as $-0.5\le F \le 0.5$?

texts:
According to Digital Signal Processing by Ashok Ambardar, The principal range is defined as follows:

  Put another way, a DT sinusoid is periodic in frequency (has a periodic spectrum) with unit period. The range $-0.5\le F \le 0.5$ defines the principal period or principal range.

I see that the major rationale behind this definition is the unit period. If only for the purpose of uniqueness, it seems to me that any interval with a unit period surely meets the requirements. I also think that $0\le F \le1$ is more fit for the purpose, because it is more easy to remember and aesthetically beautiful. In conclusion, my question is:

Is there a special reason why the principal range is defined that way?


texts: Eliminating drift generated from double integration of acceleration signal using Envelope Method

texts:
I'm trying to remove the drift generated upon the double integration of a noisy acceleration signal. But this question discusses only removing the drift upon single integration to generate velocity signal.
I'm following this research paper which uses Envelope method to remove the drift generated upon double integration of a signal.
TLDR Envelope Method for a given discrete signal $x(n)$:

Identify all the local extrema of $x(n)$
Interpolate between maxima (resp., minima) by a cubic spline to form the upper envelope $e_{u}(n)$ (resp., the lower envelope $e_{d}(n)$)
Calculate the mean of the envelopes $e_{a}(n) = (e_{u}(n) + e_{d}(n))/2$
Compute $y(n) = x(n) - e_{a}(n)$

Example I was trying to solve using envelope method
t = np.arange(0, 20, 0.1)
f1 = lambda t: 0.1*np.sin(np.pi*t) + 0.1*np.sin(20*np.pi*t) #Clean accleration signal
f2 = lambda t: 0.1*np.sin(np.pi*t) + 0.1*np.sin(20*np.pi*t) + 0.01 #Noisy acceleration signal

Upon Single integration for velocity:

Then located maxima and minima and performed cubic interpolation to generate upper and lower envelopes respectively using CubicSpline Method from the scipy package.

Then Generated mean of the envelopes:

Then Subtracting the mean of the envelopes from the Drift prone velocity:

I don't know what I did wrong but as it can be seen in the final plot, clean signal of velocity does not match the noisy signal corrected using the envelope method.
I know there are other/better methods for correcting the baseline offsets but as starting point, the envelope method seemed easier to implement. If there are methods better than this and easier to implement, I'm all ears.
I would like to know what mistake I made along the way.


texts: How do I compute the gradient vector of pixels in an image?

texts:
I'm trying to find the curvature of the features in an image and I was advised to calculate the gradient vector of pixels. So if the matrix below are the values from a grayscale image, how would I go about calculating the gradient vector for the pixel with the value '99'?

21 20 22 24 18 11 23
21 20 22 24 18 11 23
21 20 22 24 18 11 23
21 20 22 99 18 11 23
21 20 22 24 18 11 23
21 20 22 24 18 11 23
21 20 22 24 18 11 23

Apologies for asking such an open ended question, I've never done much maths and am not sure how to start tackling this.


texts: Difference Between Convolution and Multiplication

texts: I read that multiplication is convolution in frequency domain. I also understand that convolution is just polynomial multiplication. Can somebody explain what are the advantages of doing convolution in frequency domain? Also, i would like to know how to multiply two signals in time domain and what is the significance of it.


texts: Frequency modulation audio synthesis: clicks/pops when changing modulator frequency dynamically

texts:
I'm very new to DSP and working on a FM VST. It's mostly up and running, or at least it generates FM-like sounds. I want to be able to change various parameters dynamically while audio is generated, such as the modulation index, for automations and later for LFOs.

I had a problem with clicks and pops when changing values, and solved it by interpolating the values over a small number of samples. However, this doesn't seem to work when dynamically changing the frequency of the modulator. It just causes strange frequencies during the transition, which is not what I want.

I'm speculating that maybe I could introduce the new frequency immediately just when the carrier has completed a sine cycle, and implemented that, but that doesn't remove the clicks (which might be because of some bug in my code, or because this is the wrong approach completely.)

As you might have noticed, I'm mostly unaware of the mathematics involved.

A very simplified version of my (Rust) code, which should however show the basic method I'm using, is:

let mut time = 0.0; // EDIT: is not reset with each buffer loop
let time_per_sample = 1.0 / 44100.0;

let carrier_frequency = 440.0;
let modulator_frequency = 880.0;
let beta = 2.0;

for sample in buffer.iter_mut(){
    *sample = (
        (carrier_frequency * time * 2 * PI) +
        beta * (modulator_frequency * time * 2 * PI).sin()
    ).sin();

    time += time_per_sample;
}

I'm currently not scaling beta with modulator frequency, if that matters.

In FM synthesis, how do I change the modulator frequency while a sound is playing without clicks or pops?


texts: Digital filter for sharp impulse in data

texts: I am looking for an algorithm or a filter to remove sharp peaks from my data. I am collecting raw data after every 1 second from an sensor through an ADC. The ADC has an internal FIR filter. I use this filter to remove the 50-Hz noise. So, if there is huge disturbance or jerk to the sensor, it gives out sharp values. I want to filter out these sharp values. Also, I want the raw values to be sensitive to small changes but avoid a sharp jump in the value. Why do I want to remove these sharp peaks or impulses from the raw data? - Because it disturbs the Kalman filter ;- the Kalman filter estimates position and velocity. I am interested in velocity values of my Kalman filter. These values try to follow the sharp peak either up or down. Hence, velocity output is affected and then needs few more samples to determine a proper actual value.


texts:
I want to compute the 1-D noise power spectrum (NPS) for a uniform CT image. The equation of the 2D NPS is as following:
$$
NPS(f_x, f_y) =\frac{1}{N}\sum_{i=1}^N|DFT_{2D}[I_i(x,y)-\bar{I}_i]^2\frac{\Delta_x\Delta_y}{N_xN_y}
$$
whre $DFT$ is the discrete fourier transform, $I_i$ is a ROI, $\bar{I}$ is the mean of the ROI. The 1-D dimensional (or radial) NPS is defined as:
$$
f_r = \sqrt{f_x^2+f_y^2}
$$
Assuming only one ROI and obviating the units factor, I compute the 2D NPS as:
fft = np.fft.fft2(roi-np.mean(roi))
fft = np.fft.fftshift(fft)
NPS_2D = np.abs(fft)**2

How can I compute from here the 1-D radial NPS?


texts: System identification/ Filter estimation to mimic frequency equalizer of audio with Scipy

texts:
At the current problem I'm working on, I have two signals: One "original" signal that contains audio (voice). The second signal is the same audio file but edited with a frequency equalizer, for example to make all frequencies between $649-677\textrm{ Hz}$ louder.

What I'm trying to achieve now is to "teach" a SCIPY filter to mimic this behavior. Therefore I created a function with two butterworth-filters and try to curve_fit the $x$-data to the $y$-data. The intuition is, that like this the system learns the optimal frequency intervals to mimic the equalizer. Obviously it doesn't work as supposed (no curve fit achieved most of the time. If I achieve a curve fit and apply the filter to the original data, it didn't change at all). Any suggestions?

import numpy as np
from scipy.optimize import curve_fit
from scipy import signal

xdata = voice_1
ydata = voice_2

# Function to optimize, supposed that two bandpass filters are enough
def func(x, p1,p2,p3,p4):
    b, a = signal.butter(2,[p1,p2],btype="band")
    x = signal.lfilter(b,a,x)
    b, a = signal.butter(2,[p3,p4],btype="band")
    x = signal.lfilter(b,a,x)
    return x

# Optimize function to achieve a curve-fit and therefore get the right frequency response in p1,p2,p3,p4
popt, pcov = curve_fit(func, xdata, ydata,p0=(0.5,0.5,0.5,0.5))

What I also tried was creating a xsignal containing of white-noise, creating a ysignal where I changed some frequency levels and calculating a transfer function H as FFT(ysignal)/FFT(xsignal). As soon as I apply this function to other data than white noise the results seem to be wrong as well.


texts:
I read this paper: https://arxiv.org/pdf/1305.2460.pdf

And there is a formula about MMSE:$\mathbf W^*_{MMSE}= E[\mathbf s \mathbf y^*]E[\mathbf y \mathbf y^*]^{-1}$

$\mathbf W _{BB}$:Baseband combiner

$\mathbf W _{RF}$:RF combiner

$\mathbf W $:The combination of $\mathbf W_{RF}$ and $\mathbf W _{BB}$

$\mathbf W^*$ : the hermitian  of $\mathbf W$

$\mathbf s$:the signal on the left

$\mathbf y$:the signal when $\mathbf s$ goes  through the channel

Why can the :$\mathbf W^*_{MMSE} $ be written as $E[\mathbf s \mathbf y^*]E[\mathbf y \mathbf y^*]^{-1}$.why should we multiply the these two signal ,$\mathbf s$ and $ \mathbf y$,and average them ?Does anyone have information about this formula ?


texts: Why is successive decomposition of a signal performed only on low pass component?

texts: The question says it all. In typical (wavelet-like) decomposition of a signal, why is only the low pass component chosen for successive decomposition ?


texts: Baseline Correction: What is the concept of a baseline shift and baseline correction?

texts:
I have a laser induced fluorescence signal data-set. Currently the processing pipeline performs baseline correction by manually moving the signal so that the initial point is at the origin. Is this a right approach?

Is it to be done only if the shift is predetermined or known?
Does that mean baseline error signal has zero frequency?
Or can there be low frequency components which can be called baseline errors?

Edit:
Laser Induced Fluorescence signal is used to get relative quantities of collagen, NADH etc from the tissues.

Raw signal:

I am from neither signal processing nor physics background. The requirement I have been given is to develop a software for analysing the preprocessed data. However, I observed that currently the preprocessing uses the above said manual method for baseline correction.


texts: What is the name of signal / (signal + noise)

texts:
Signal-To-Noise ratio is defined as

$$SNR = \frac{P_{signal}}{P_{noise}}$$

For my application, I find the following metric to be more useful

$$\frac{P_{signal}}{P_{signal} + P_{noise}}$$

Does it have a name?

Context: I have a function $F$ that analyses a dataset and outputs a number. I want to test how the output of that function depends on the added noise. For this purpose, I create a surrogate dataset $X$ with zero noise, and white noise $N$, and zscore each of them. Then, I produce the noisy dataset

$$Y(\alpha) = \alpha X + (1 - \alpha)N$$

for multiple values of $\alpha \in [0, 1]$. I finally proceed to plot $F(Y)$ as a function of $\alpha$. I want to know what is a good name for the variable $\alpha$. I am tempted to call it SNR, but that is not true according to definition of SNR. I could change the definition of $Y$ such that the free parameter would be exactly SNR, but then its limits would be $[0, \infty)$, which is less convenient than $\alpha$ to sample and plot on x-axis.


texts: Good Language for Implementing Computer Vision System / Algorithm / Application?

texts:
I am trying to implement a content based image retrieval system but before I do so I would like to get an overview of some programming languages suitable for this task (having good libs and such).

Does anyone know some good languages and libs for that kind of task? What about Python or Java?

Best


texts: How to get the amplitude output of a single frequency from a Resonant Bandpass? (ie. Using a reso BP as an envelope...)

texts:
A resonant bandpass like this:

is resonating at a frequency of 125 Hz. You are controlling the decay time by modulating $Q$ accordingly. The BP is being excited by a MIDI triggered impulse.

At its resonant frequency it will decay at a natural rate of $ y= c^{-x}$, i.e. it will give a nice exponential decay.

Is there any way to get the output level of the bandpass at its resonant frequency (125 Hz)?

If it is possible to get the output/amplitude level at this specified frequency, one could use the bandpass as a synth envelope.

This might be a bit computationally expensive, but resonant BPs have some unique properties that might be fun to exploit if this is possible. I'd at least like to see what I could get out of it.

For reference, the resonant BP filter I'm using in my projects is the one here:

https://github.com/JordanTHarris/VAStateVariableFilter/blob/master/Source/Effects/VAStateVariableFilter.h
https://github.com/JordanTHarris/VAStateVariableFilter/blob/master/Source/Effects/VAStateVariableFilter.cpp

  From The Art of VA Filter Design by Vadim Zavalishin, TPT State
  Variable Filter: TPT -> Topology Preserving Transform

  This filter is  based off of the trapezoidal integrator, which
  produces a bilinear  transformation. This filter does the proper
  cutoff prewarping needed  for the TPT structure, as explained by
  Zavalishin. It also handles the  problem of delayless feedback loops
  that the trapezoidal integrators  introduce.


texts:
For a large amount of musical audio tracks I am doing the following with every single track:

I am slicing the track into very small pieces whereas each piece represents a note onset event. So the piece begins at a note onset event and ends before the next event starts. The result is having hundreds of very small, typically sub-2-second slices for each track.

Now I want to take one of these slices - a totally random pick - and search through all the remaining slices to find the slice that is most similar to the picked one.

Most similar means that it "sounds" like the picked one. More specific this means that it is having the same key, pitch - not timbre and not rhythmically (since rhythm is cut off by slicing at note onsets)

The Problems

To find the slice that is most similar to / that most "sounds-like" a randomly chosen slice I have to determine its "sound". I have been reading about MFCCs but I am not sure if this will help determine the sound, which in this case will be key, pitch.

Next, when having a way to determine the "sound" in numerical way I need to find a way how to compare these results. There are things like euclidian distance or consine-similarity.

Last but not least the slices are of different length.

What I have done so far

Slicing based on note onset-events is done with the help of the onset-feature extraction methods of the librosa python library. This function returns a list of onset-events represented as time-stamps. Each time-stamp is used as a "cut-mark" to slice the audio tracks.

I have been playing with the fastDTW python library which does a dynamic time warping analyzation, compares the result with using an euclidian distance function and fed it with slices. But I am not sure if the result is the distance in MFCCs

The question

To summarize the above into a single question:

How to match a piece of very short audio based on key and pitch to find a piece in a large database that is most similar to it?


texts: What is the best estimate of a signal given multiple noisy realisations

texts:
I assume that the noise corrupting the sought-for signal is [Edit: Gaussian] white noise of zero mean and unknown variance. Is the optimal solution simply the mean over the realisations (the ensemble mean), or, we can have a better estimate, say, in terms of a smaller root-mean-square-error?
Edit: I found that my question have been asked already. Although the practical context is different, as in my case there is no concern that the different observations on different sensors could be correlated or that the corrupting process is slightly different. The answer to that question suggests that superposition, i.e., ensemble mean, is the best (“efficient"?) estimate. However, it occurs to me that it might not be the case, as a moving-window temporal average of the ensemble mean would yield an even smaller RMSE if the signal is sufficiently smooth. Unfortunately, there was no published reference given there. It would be great to find the answer in a textbook or paper, as it would surely clarify the conditions under which the result/theorem applies.
In any case, even if the moving average of the ensemble mean yields a better RMSE than the ensemble mean alone, I wonder if there is an even better estimate. Intuitively -- and it might be a common failure of intuition -- there might be value (information) in having the relaisations available "separately" as opposed to only their superposition, the ensemble mean. Any further help would be much appreciated.


texts: The Fourier Series, Amplitude and Phase Plot of a Saw Tooth Waveform

texts:
I am trying to find the amplitude and phase plots of the saw tooth waveform pictured.I have already computed the Fourier series of the waveform but I don't know how to derive the amplitude and phase plots from the sawtooth's Fourier series.

$$
   x(t) = \begin{cases}
          \frac{V}{T}t + V & \text{$-T < t < 0$} \\ \\ \\ \\
          \frac{V}{T}t & \text{$0 < t < T $ } \\
         \end{cases}
$$

The Complex Fourier series of this waveform is

$$
  x(t) = \sum_{n=-\infty}^{n = \infty} C_n e^{jnw_0t}
$$

$$
x(t) = \sum_{n=\infty}^{n=\infty}\left[ \frac{jV}{nw_0T} e^{jnw_0t}
      + \left( \frac{jV}{2nw_0T} - \frac{V}{n^2w_0^2T^2} \right) e^{jnw_0(t + \frac{T}{2})}
      + \left( \frac{V}{n^2w_0^2T^2} + \frac{jV}{nw_0T}   \right) e^{jnw_0(t - \frac{T}{2})}
\right]
$$

where

$$
    w_0 = 2 \pi f_0 = \frac{2 \pi}{T}
$$

I know the amplitude plot is $|C_n|$ vs Frequency and the phase plot is $Arg(C_n)$ vs frequency but how would I do the get the amplitudes and phases from a fourier series such as this one?

Addition:

Simplifying x(t) by replacing $w_0T = 2\pi$ and $e^{j\pi} = -1$ gives me

$$
  x(t) = \sum_{n=-\infty}^{n=\infty}
        \begin{cases}
      \frac{V}{2\pi n}\left( \frac{2 + 3(-1)^n}{2} \right) e^{j \left( \frac{2 \pi n t}{T} + \frac{\pi}{2} \right)} &  \text{if n $\ne$ 0} \\ \\ \\ \\ \\
      C_0 = \frac{VT}{2} & \text{ if n = 0 }
         \end{cases}
$$

Still not sure how I can interpret this, but it seems for $f = 0$, amplitude = $\frac{VT}{2}$ and phase = 0, and for f = $\frac{n}{T}$, amplitude = $\frac{5V}{4 \pi n}$ ( for even n ) and $\frac{V}{4 \pi n}$ (for odd n), with the phase = $\frac{2 \pi nt}{T} + \frac{\pi}{2}$ for both even and odd cases, is that right?


texts: I want to simulate a direct sequence spread spectrum (DSSS) system and the receiver works with matched filter. I want the received power to be different for each user, in other words, SINR shouldn't be 0. Is there any idea how to do that in matlab?


texts: Radar terminology - Specific meaning of "video signal"

texts:
In the radar literature, particularly in older references, the term "video signal", "downrange video", or just "video" is used to describe the radar signal at a certain point in the processing chain.  Also, I have come across the related term "video frequencies".

In older radars with analog processing, I interpret the "video signal" to mean the voltage as a function of time at the output of an envelope detector after downconversion from the carrier frequency.

In modern radars, particularly coherent pulse-Doppler systems, the term "video signal" seems to be equivalent to the general signal processing term "complex baseband signal" or "complex envelope", in that it contains an in-phase and quadrature component. Although sometimes I see plots of the "video signal" where the magnitude of the baseband signal is plotted versus time, which seems roughly equivalent to the envelope-detected signal of an analog radar.

I interpret the phrase "video frequencies" to simply mean the signal has been downconverted to be centered at 0 Hz.

Are these interpretations of the term "video" correct, and is there any other nuance I should be aware of?


texts: Behaviour of the poles in transfer function $H(s)$, given system properties

texts: If a linear system is causal and its impulse response is an energy signal. What's the behaviour of the poles of $s$-domain transfer function $H(s)$?


texts: Is `xcov()`More Accurate Than `xcorr()` to Compute the Cross Correlation of Signals with Non Zero Mean Values?

texts:
I have to compute the cross-correlation between two transient signals, which could be decomposed into a trend (with non-zero mean value) + noise.
In particular I am interested in the max of the cross-correlation.
It seems that in MATLAB the cross-correlation is more accurate if it is calculated  using the function xcov() rather then xcorr(), probably as a consequence of the fact that the function xcov() removes the mean value of the signal.
An example of two signals between which I would have to measure similarity can be this one:

Do you know if this makes sense and why?


texts: [2D fourier transform]: Most people can't explain this

texts:
I am confused with 2d magnitude plot of frequency spectra. So we have 2 images, the first one is shown at the top, and the dilated or enlarged version of the white box is shown at the second row.

For the dilated version, in the spatial domain when travelling in the $x$-direction, you see a fast change in intensity, and when you travel in the $y$ direction, the change is slower, so that the $v$ direction frequency component is smaller. In the frequency domain, $x$ maps to $u$, and $y$ maps to $v$.

I do understand that when you enlarge in one domain, you must do the opposite to the other domain.
The thing I don't understand is that in the dilated version, when you travel in $x$, and you still see the same rate of change as in the original image. Since $u$ maps to $x$ in the frequency domain, we expect that the frequency spectrum looks the same in the $u$ direction. However, the result is that, in the $u$ (or the horizontal) direction of frequency domain, its frequency component shrinks; the $v$ direction remains intact.  But we just change its $y$ direction!

Update:
To be more precise, please refer to the area of the red box. In the second figure, it gets shrink.


texts:
Please explain the terms: dynamic range, and image contrast, and the difference between these two.
Also, how can these two be understood by seeing an image by naked eye for the sake of understanding.
Based on the initial comments on this post, I am trying to add a few lines from the textbook which probably will provide the necessary context behind this question.

Sometimes, the range of values spanned by the gray scale is referred to as the dynamic range, a term used in different ways in different fields. Here, we define the dynamic range of an imaging system to be the ratio of the maximum measurable intensity to the minimum detectable intensity level in the system. As a rule, the upper limit is determined by saturation and the lower limit by noise, although noise can be present also in lighter intensities.
The dynamic range establishes the lowest and highest intensity levels that a system can represent and, consequently, that an image can have. Closely associated with this concept is image contrast, which we define as the difference in intensity between the highest and lowest intensity levels in an image.

For the context, I have been following the textbook Digital Image Processing, 4th Edition, Gonzalez and Woods, pp. 69.


texts: The minimal signal to noise ratio (SNR) for people to understand a speech in the noisy background

texts:
This question seems easy to find an answer but I got lost in the end. I am trying to find the threshold for people to understand speech in a noisy environment. For example, assume the background noise is $\mathbf n$ and the speech signal is $\mathbf s$. I wanna know the threshold thr for the speech being recognizable by a human when:
$$
10\log\left(\frac{\lVert \mathbf s\rVert}{\lVert \mathbf n\rVert}\right) > \text{threshold}\implies\quad\text{so the speech $\mathbf s$ is recognizable by human}$$

The most relevant scientific fact I found is the absolute hearing threshold, such as the ISO 226.

However, I got confused to interpret this ISO 226 figure because the $y$-axis is in SPL (dB). Based on my understanding, the SPL is also defined based on the minimal hearing threshold, which is kind of weird to understand how much signal strength (of a speech) is actually necessary for people to recognize.

Can I say the signal strength of a $10\textrm{ kHz}$ signal needs to be $\approx 5\textrm{ dB}$ higher than the noise floor for being recognized by the human based on the red lines shown in this ISO 226 figure?
If it is true, how can I know the threshold for a speech signal covering multiple frequencies?


texts:
can anyone gives any link or explained to me on how sensor fusion works on GPS/IMU. as of now, i have gain learn few of the algorithms on Kalman Filter. Currently, im using an arduino Uno as my data acquisition card and MPU6050 as my IMU.

Thank You.


texts: what symmetry does system function H(z) have if h[n] is real?

texts:
assuming h[n] is real...

If frequency response $H(e^{j\omega})$ is Conjugate Symmetric:

$$
H(e^{-j\omega}) = H^*(e^{j\omega})
$$

$$
H(e^{j\omega}) = H^*(e^{-j\omega})
$$

Then, what symmetry does the System Function $H(z)$ have?  Is it the same symmetry as the frequency response  $H(e^{j\omega})$, or is some type of symmetry like conjugate reciprocal symmetry?

$$
H(z) = H^*\left(\frac{1}{z^*}\right)
$$

This is confusing the heck out of me, because they start with something that is conjugate symmetric as a frequency response then convert it to a z transform by substituting $z=e^{j\omega}$, then, suddenly by changing variable to z its "conjugate reciprocal symmetric", instead of just plain "conjugate symmetric"... except it doesn't actually tell you this anywhere... that the system function has this symmetry...

Would this be some weird property that "Conjugate reciprocal symmetry" is the same as "conjugate symmetry" on the unit circle. and the frequency response is really a degenerate case of "conjugate reciprocal symmetry"


texts: What features can I extract from optical fibre signal?

texts:
I have sensors placed in pipelines and I have amplitudes coming from it. I want to detect the type of activity taking place at the sensors(like digging,tunneling,clamping etc). So I have a signal which consists of 30 amplitudes, what features can i extract.

What are the assumptions that I have to make(like the signal should be stationary etc). Is my signal stationary in this case.If it is not can I apply frequency domain features.What are the differnt features I can use apart from mean,median,mode,skewness,kurtosis etc.I am trying t build a nueral network classifier.Is not my signal continous if it comes each second(amplitudes).Can I apply fourier tranform here.

Sorry I am a complete newbie in the field


texts:
Please help me understand the following MATLAB code for Ideal Low pass filter. I am unable to understand the Part2 in the below code. Please explain me why we are doing like this.

I have read the Rafael C. Gonzalez's Digital Image Processing Using Matlab 2E which explains my question but I couldn't understand properly. It states that DFTUV Computes meshgrid frequency matrices. I don't understand this "meshgrid frequency matrices".It will be very much helpful if someone could explain me clearly.

 %IDEAL LOW-PASS FILTER

%Part 1
        function idealfilter(X,P) % X is the input image and P is the cut-off freq
        f=imread(X);  % reading an image X
        [M,N]=size(f); % Saving the the rows of X in M and columns in N
        F=fft2(double(f)); % Taking Fourier transform to the input image
%Part 2 % I don't understand this part
        u=0:(M-1);
        v=0:(N-1);
        idx=find(u>M/2);
        u(idx)=u(idx)-M;
        idy=find(v>N/2);
        v(idy)=v(idy)-N;
        [V,U]=meshgrid(v,u);
        D=sqrt(U.^2+V.^2);

%Part 3
        H=double(D<=P);       % Comparing with the cut-off frequency
        G=H.*F;               % Multiplying the Fourier transformed image with H
        g=real(ifft2(double(G))); % Inverse Fourier transform
        imshow(f),figure,imshow(g,[ ]); % Displaying input and output image
        end

I tried to run each commands in Part2 individually for M= 8 and N=8. I get

u=0:(M-1); ==> u = 0 1 2 3 4 5 6 7

v=0:(N-1); ==> v = 0 1 2 3 4 5 6 7

idx=find(u>M/2); ==> idx = 6 7 8

u(idx)=u(idx)-M; ==> 0 1 2 3 4 -3 -2 -1

idy=find(v>N/2); ==> idy = 6 7 8

v(idy)=v(idy)-N; ==> 0 1 2 3 4 -3 -2 -1

[V,U]=meshgrid(v,u); ==>

V=

     0     1     2     3     4    -3    -2    -1
     0     1     2     3     4    -3    -2    -1
     0     1     2     3     4    -3    -2    -1
     0     1     2     3     4    -3    -2    -1
     0     1     2     3     4    -3    -2    -1
     0     1     2     3     4    -3    -2    -1
     0     1     2     3     4    -3    -2    -1
     0     1     2     3     4    -3    -2    -1

U =

     0     0     0     0     0     0     0     0
     1     1     1     1     1     1     1     1
     2     2     2     2     2     2     2     2
     3     3     3     3     3     3     3     3
     4     4     4     4     4     4     4     4
    -3    -3    -3    -3    -3    -3    -3    -3
    -2    -2    -2    -2    -2    -2    -2    -2
    -1    -1    -1    -1    -1    -1    -1    -1

I am unsure why they are doing like this. How it affects the image.Please help me understand. The fftshift is used to avoid the wraparound error. Is the above operation anyway related to fftshift command? My understanding is that they are doing this to avoid using the fftshift command. Thanks in advance. Help me learn.

Reference: Rafael C. Gonzalez's Digital Image Processing Using Matlab 2E


texts: How the noise in time domain affect the power in frequency domain after FFT?

texts:
I am new to signal processing. And I am puzzled when studying FFT.
I create time series plus a random noise in Python:

import numpy as np
N=1000
x = np.linspace(-50,50,N)
noise = np.random.random(N)*0.1
y = np.sin(2*np.pi*x/10) + noise

Then perform FFT to the time series and get power spectrum.
But I find the spectrum is totally different when I execute my script each time.
I know it must be the random noise's effect, which are different in different execution. However, as you can see, the sine function is periodic, so we should see clearly a signal in the power spectrum. The puzzle is, the very strong periodic "signal" is submerged in the noise in frequency domain FOR SOMETIME.

I want to know how the noise in time domain affect the noise&signal in frequency domain.

Many thanks!


texts: Selection of transforms, windows, wavelets for current signal analysis

texts:
I am new to this topic but I already read about the propperties of different signal analysis methods. I am stuck with the obvious advantages of FFT, STFT and Wavelet transforms but can't find good parameters for them.
I have a current signal from a motor that should be transformed to give me characteristic features. It will beanalysed with a machine learning algorithm. Its envelopecurve can be represented as a test parabola of the form:
$y= -0.4\cdot(x-4)^2+3$ with $0\le x\le8$ and $y\ge 0$
Right now I try different transform algorithms (FFT, STFT, PSD, DFT, CWT) with the test parabolas and different parameters to see which transform could give me hints about charakteristics of the signal in Python. I want to detect the position and magnitude of dents in the signal to use them as features.
Do you have any suggestions for resources to make a good choice of the transform algorithms, windows, wavelets in general?


texts: Doppler Shift of Phase Coded Pulse Compression Waveform

texts:
Suppose I want to transmit the signal:

$$ x(t) = g\Big(\frac{t-t_{0}}{T}\Big) \cdot \cos(2 \pi f_{0} t + \theta_{0}) + g\Big(\frac{t-t_{1}}{T}\Big) \cdot \cos(2 \pi f_{1}t + \theta_{1}) $$

Where $g(\cdot)$ is some window function of duration $T$ and $t_{1} = t_{0} + T$. Suppose that it encounters some target at range $R$ traveling with some velocity $v$, giving rise to a Doppler shift $d$.

My question:

Can I then represent the return signal as (with $c$ the speed of light, and $a,b \in \mathbb{R}_{++}$ constants representing compressing the waveform in time):

$$ x(t) = g\Big(\frac{t-t_{0}-\frac{2R}{c}}{aT}\Big) \cdot \cos(2 \pi df_{0} t + \theta_{0}) + g\Big(\frac{t-t_{1}-\frac{2R}{c}}{bT}\Big) \cdot \cos(2 \pi df_{1}t + \theta_{1}) $$

If so, what are these constants a and b?

I suppose what I really want to find out is:

How exactly does the Doppler shift compress these pulse compression waveforms? Will the chips still be connected? ie It just compresses the entire waveform in time?

Or will there be a gap in the middle because the Doppler shift compresses each chip from the chip's midpoint? (thereby leaving a gap between chips that did not exist before)


texts: For image quantization, is it necessary to sample image?

texts: When we want to quantize an image, is it necessary to do sampling? When we know that image is a discrete signal, is it necessary to find the best samples with Nyquist rate?


texts: How to get the channel impulse response by using PRBS signal with BPSK modulation?

texts:
I want to get the channel impulse response by sending PRBS. Following is some channel measurement flowchart that I found

a(t) is the PRBS，sending it to transmitter to upconversion to BPSK modulated signal s(t)，r(t) represnet the receiving signal that pass throung real wireless channel. The receiver would downconversion the receving signal r(t) into I(t) and Q(t) signal.
After that, taking a(t) and I(t)+jQ(t) to do cross correlation to get the channel impulse response.

Yet, there is still some point that I confused about：

As far as I know, BPSK modulate and demodulate only need one I(t) signal，why the receiver output I(t) and Q(t) two signal?
After downconversion r(t), we get I(t)、Q(t) baseband signal. I am wondering aoubt the form of I(t)、Q(t) signal if I represnet a(t)、s(t)、r(t) as follow.

2

the point that I got stuck in is that is I(t) Q(t) signal BPSK demodulated signal or not? Moreover, no matter I(t) Q(t) is demoudulated signal or not, I both have problem. I describe it as below

Case 1： if I(t) Q(t) is BPSK demoudulated signal

The channel would definitely caused delay which would make the signal with phase shift that system unknown, so how can receiver demodulate the signal accurately?
Case 2：no need to do demodultion at Rx

To the best of my knowledge, if I have PRBS a(t) and the receving PRBS a(t-delay),then, after cross correlation of two signal I can get the delay time. Howerver, what if the receiver didn't demodulate the signal, how can I get the delay time and channel impulse response? Say the problem in another way is that, why calculate corss correlation of a PRBS signal and a sinusoid(I+jQ) signal can get the channel impulse response?


texts: How do i set the band filter such that it has a pass band of 100Hz to 300Mhz?

texts:
From this derivation to get the differential of a band pass filter: Id like to find out how we set the upper frequency cut-off and the lower frequency cut-off.

$$i(t)=\frac{v_i(t)-v_o(t)}{R}=C\frac{dv_o(t)}{dt}$$

So we get

$$v_i(t)=v_o(t)+RC\frac{dv_o(t)}{dt}\tag{1}$$

For the high-pass filter we have

$$i(t)=\frac{v_o(t)}{R}=C\frac{d(v_i(t)-v_o(t))}{dt}$$
which gives

$$RC\frac{dv_i(t)}{dt}=v_o(t)+RC\frac{dv_o(t)}{dt}\tag{2}$$

Let's call the time constants of the low-pass and high-pass filters $\tau_L=R_LC_L$ and $\tau_H=R_HC_H$, respectively. For the band-pass filter we need a relation between $v_i(t)$ of the low-pass filter and $v_o(t)$ of the high-pass filter. If we use $v_{oL}(t)$ to denote the output of the low-pass filter, which equals the input of the high-pass filter, we get from (1) by taking the derivative

$$\frac{dv_i(t)}{dt}=\frac{dv_{oL}(t)}{dt}+\tau_L\frac{d^2v_{oL}(t)}{dt^2}\tag{3}$$

From (2) we have

$$\tau_H\frac{dv_{oL}(t)}{dt}=v_o(t)+\tau_H\frac{dv_o(t)}{dt}\tag{4}$$

and (by taking the derivative)

$$\tau_H\frac{d^2v_{oL}(t)}{dt^2}=\frac{dv_o(t)}{dt}+\tau_H\frac{d^2v_o(t)}{dt^2}\tag{5}$$

Plugging (4) and (5) into (3) we finally get for the band-pass filter

$$\tau_H\frac{dv_i(t)}{dt}=v_o(t)+(\tau_L+\tau_H)\frac{dv_o(t)}{dt}+\tau_L\tau_H\frac{d^2v_o(t)}{dt^2}$$


texts: Is a recording of a chord merely a superposition of recordings of its constituent notes? Assuming the recording of its constituent notes are sufficiently clean.


texts: Is sound wave detection distance related to modulation algorithm?

texts:
Recently I have read this paper.

The author claimed that the audio signal detection (communication using sound signal) distance was affected by audio signal modulation method, by optimizing the audio signal's modulation algorithm, communication range between devices can be largely increased.

However, I think that the audio propagation media properties, audio receiver's performance really matter.Can somebody help me with this issue?
Thank you very much


texts:
How can I infer the coefficients for an AR(2) model given an autocorrelation plot?

What I have tried so far: I can see this a cos-wave of 0.4 Hz, and then i find the values for each step $(1, 0.9211, 0.6967, 0.3624)$. Since it is an AR(2) model I have to find to coefficients ($a$ and $b$). Then I can solve two equations with two unknowns. So $a$ is $-0.9991$ and $b$ is $1.8141$. Is that the correct approach? And is it even the correct coefficients?


texts: Is there an efficient algorithm to extract low frequency signal from audio with high frequency carrier?

texts:
I need to process an audio signal in an Android app. As shown in the two examples below, there is a 16kHz carrier signal and a lower frequency signal of varying frequency (0-4kHz). Does anyone know of an efficient algorithm to extract the lower frequecy signal in an Androd app?

http://mc.weatherflow.com.s3.amazonaws.com/media/IMG_03102014_135912.png


texts: Filtering artefacts and filtering short signals

texts:
I have a signal from EEG sensors and I try to denoise it from AC frequencies. For that reason, I estimated PSD of my signal and found that 50 Hz and 100 Hz are likely to represent noise. I constructed Butterworth filter of order four and got much clearer signal, but at the start ([0:150] segment) there is even more distortion. Why is it so? If it helps, I use lfilter from scipy.signal.

Besides, in the future I want to break a signal into smaller pieces (say, length of 100). I have tried denoising them already and it seems like such filters do not work on short segments. What can I do with this?


texts: Difference between state space and transfer function model response (in Simulink)

texts:
Why I get a different response from the same system (e.g. three phase inverter with LC filter) in state space form and in transfer function (Laplace) form when using the same PI controller values ($K_p$ and $T_i$)?

First I start with differential equations for each phase $a$, $b$ and $c$ to get state space model

\begin{align}\frac{dx}{dt}&=Ax+Bu\\y&=Cx+Du\end{align}

Than an $abc/dq$ transformation is applied (to get coupled relationship between $d$ and $q$ frame). Finally separate equations for $d$ and $q$ frame can be written and transformed to Laplace. From there I can get control scheme and calculate $K_p$ and $T_i$ to get desired overshoot and settling time.

But when I use the same $K_p$ and $T_i$ in the state space model I get extremely noisy and oscillatory response. My question is why is that? I read previous similar question “Control theory: Laplace versus state space representation” and the difference is that the transfer function neglects initial states.

Additional question: how to then calculate PI controller values when using state space form to get desired overshoot and settling time?


texts:
I am new in signal processing. I generated a signal with $f_{in}=10 \mathrm{kHz}$ and also take 64 sample from this signal after doing some process in an ADC block. I want to convert the result to the main signal and compare them whit each other. So if what is the difference between taking an FFT of the 64 points or other numbers like 1024 in the same measured time and what should be changed?

Thank you


texts: LTI system $y(t)=x(t-T)$ with or without memory

texts:
How can I verify if the LTI system ($T$ is a real number, $y(t)$ output, $x(t)$ input):

$$y(t)=x(t-T)$$

is with or without memory? I know that, if $y(t)$ depends only on $x(t)$, the LTI system will be without memory. In the above example, does it depend on $t-T$ or only on $t$?


texts: Object identification based on both shape and intensity -- i.e., identify the stars and their diffraction spikes at the pixel level

texts:
Here's an example image to make the problem very clear:

I've used OpenCV's blob_log() as well as the rank.otsu threshold approaches. The problem with the blob detection is that the blob radii are quantized, e.g., 3, 7, 11, etc. The otsu local adaptive threshold works fairly well but needs severe hyperparameter tuning -- in other words, it works in some locations but not others.
I don't know how I can ask the following question: "find all circular blobs in the image. If the blob is large (meaning it is overexposed), expand the search to include diffraction spikes (at known fixed angles) plus the Airy disk."
My goal is to remove the stars and their optical effects from the image, then use an inpainting algorithm to fill in the missing pixels. I have several inpainting candidates to try.
There is noise in the image, and I'm fine with missing any stars that are indistinguishable from noise.
This is one channel -- the other image channels do add additional information, and the actual removal of stars/effects will be based on the logical or of all three analyzed channels.
I am aware that there are other methods for star removal that pop up in google search. The best automatic one I've used is starnet, e.g. in https://github.com/nekitmm/starnet . The issue I have with it is it doesn't separate out the star mask but goes ahead and does the inpainting -- unfortunately, very poorly in large regions. And it doesn't handle spikes well, per the author's commentary and my observations.
I wanted to avoid a machine learning approach. Instead, I wanted to solve the problem directly from first principles. It seems feasible to build a structural model of the star/spike/airy disk with some effort(e.g., as central disk at max intensity becomes larger, spikes grow larger and so does Airy disk.) But how do I match this model to the objects in the image?
Thanks in advance.

The desired output is a 1 bit mask image. Bit set to 1 if this is a star pixel, 0 otherwise. I don't have a problem converting a list of (y,x,r) values to a bit mask, and already have code to do that.
The blob detectors I have used (a) don't compute accurate blob sizes (b) generate blobs for some of the noisy areas.

Regarding finding the isolated blobs being a snap, give me an idea of what you consider is a "snap." My very first attempt looked for local maxima and attempted to grow a circular region. It was very slow and had problems with noise.

The region-growing approaches all failed miserably. A different 2d filtering approach turned out to be more promising. The basic idea is to:

Capture all of the overly bright areas via thresholding, e.g., against around 248 in the bottom image. That gives the first mask = image > 248, e.g.
Apply an emboss filter at 45 and 135 degree angles (filter kernels are [-1 -1 0][-1 0 1][0 1 1] plus 128 for the 45 degree angle.)
Threshold values more than 45 away from grey (128). mask = (embossed < 128-45) | (embossed > 128 + 45), e.g.
Or together all of the three thresholds.

That gives the following result:

That approach has two magic numbers, yes. But it works fairly well for such a simple algorithm.
I'm aware the blobs are a bit too big in places. Also, the blue and red channels of the original image don't work quite as well due to more noise in them. Time to experiment further.


texts:
I'm programming in matlab. I have processed image:

How can I separate them some thing like this:

In other words, I want to separate points that are near together without morphological operations.

I note that I do not want to use morphological operation such as dilation or erosion.


texts:
As I am newbie to signals, I have collected an appliance signal in frequency domain as follows:

(PSD- Power Spectral Density). So, I need to calculate the SNR (Signal to Noise Ratio) and BER (Bit Error Rate) caused by this signal in Powerline Calculation.
So, I have made these codes in Matlab, but what I am stuck with is calculating the SNR and BER.

bits=10000; %number of bit
b=randi([0,1],1,bits); % generate random [0,1]
t=0:1/30:1-1/30; % Time period allocated for the signal

%ASK Carrier Signals
carrier_signa_l= sin(2*pi*t);
E1=sum(carrier_signa_l.^2);
carrier_signa_l=carrier_signa_l/sqrt(E1); %unit energy
carrier_signal_0 =0 * sin(2*pi*t); % zeros for 0 bits in the carrier signal

%MODULATION
ask=[];
for i=1:bits
    if b(i)==1 % If bit = 1
        ask=[ask carrier_signa_l];
    else
        ask=[ask carrier_signal_0];
    end
end


texts:
This question was asked in one of our quiz. Question is

Determine if the system with the input-output relationship given by
$$y(t) = \int_{t-10}^{t} \cos(\tau)x(\tau)d\tau$$
is linear and time invariant.

I was able to prove linearity but was not able to prove the time invariance of the system.

My Try
For invariance we need to show output resulted from $x(t-t_o)$ is same as $y(t-t_o)$.
Let $$y_1(t) = \int^{t}_{t-10} \cos(\tau)x(\tau-t_o)d\tau.$$
Now when I change of variable to $z=\tau - t_o$, $dz = d\tau$ it leads to
$$y_1(t) = \int^{t-t_o}_{t-10-t_o} \cos(z+t_o)x(z)dz$$ where I get stuck (using $\cos(A+B)$ identity doesn't seem to work well) and not able to proceed further.
For $y(t-t_o)$ integral becomes $$y_2(t-t_o) = \int^{t-t_o}_{t-10-t_o} \cos(\tau)x(\tau)d\tau$$
From here it seems to time variant system. But when $t_o=2\pi n$ it becomes time invariant. But system cannot be time invariant and time variant. That's the doubt I have with this question whether the system is time invariant or time variant and why.


texts: Can you detect circles only using the hough line transform?

texts:
I'm not talking about the Hough Circle Transform (where you replace the representing eqns, hence the parameters with a 3D set) but a Hough Line Transform.

My solution to this:

A hough line transform maps lines to a single point in (p,theta) space. This point contains the number of points lying on the line in $(x,y)$ (cartesian) space. Conversely, a point $\mathbf{A}=(x,y) \in \mathbb{R}^2$ maps to a curve in polar $(r,\theta)$ space. This is because a point belongs to an infinite number of lines. Now, imagine a circle:

where the tangent $\mathbf{AB}$ is perpendicular to the line connecting the center and the point of contact ($\mathbf{NA}$). Let's call this line the radial line. Since the circle is a symmetrical object, this applies to every point on it.

This means essentially, that a circle is constructed of such infinite tangent lines which are perpendicular to the radial line. The tangents map to the bin in polar space: $\mathbf{A} \rightarrow (r, \theta)$. So essentially, the circle in $(x,y)$ space becomes a line in $(p,\theta)$ space. Am I correct in saying this?

Then could we apply a Hough transform on the Hough matrix itself to detect circles in the original $(X,Y)$ space?

(I know academics can be ruthless but newbee here so please be kind when tearing me a new one.)


texts: Find Bandwith from Spectral Efficiency and Eb/N0

texts:
to give you a short intro of why I am asking here. My Uni is offering a TeleCom Lecture, I love the topic but all they teach is electronics, the exercise sheets are still TeleCom, we get no supporting material and after a few days of Google searching I have reached maximum confusion. Send help ;)

Ok here is the Deal:

We have a BPSK Modulated Signal with spectral efficiency of p = 0.7 bit/s/Hz.
We want to Transmit Rb = 2.048 Mbit/s
In addition, BER should be 10^-6 or Eb/N0 = 10.5 dB

Task: Find the Bandwith B.

I thought that Rb/p = B  will give me the desired result.
But here I never used Eb/N0. So I assume I am missing something.

What am I missing? Or is the simple relation I found already correct and Eb/N0 is just there to confuse me?


texts: Linear systems: Square root of input product

texts:
Hi guys i'm studying signals and systems, and my professor ask us if this signal is linear or not
$$y(t) = \big[x(t − 1)x(t + 1)\big]^{\frac 12}$$
the fact that is in the form of $x\cdot x$ told me that that's not linear but the square root confuses me can you explain to me if this is linear or not?