texts: Signal Estimation after detection Part 2

texts:
I have a binary information source signal $s(t)$ that is corrupted by additive White Gaussian noise $w(t)$ at a particular SNR. The received signal is:
$$x(t) = s(t) + w(t)$$
Then I have created a matched filter $h(t)$ as the time reversal of the source binary signal $s(t)$.
Question: After signal detection, how to estimate the clean signal $s(t)$? I have used the sign() operation. Is that the correct way or should I use sophisticated methods like MLE, LMS etc?
In many implementations, a hard threshold zero is used to decode the signal in order to get back the transmitted source symbols $\hat{s}(t)$. Is that the correct way? Is my implementation correct where I have used sign function to estimate the symbols.
This is my implementation. Please correct me where wrong.
clear all
N = 50;

input = rand(1,N)>0.5;
s=(2*input-1); %input
x = awgn(s,15,'measured'); %received noisy signal

matched_filter_h = flipud(s);
s_hat = sign(filter(matched_filter_h,1,x));

The code output shows that $s(t)$ and $\hat{s}(t)$ are identical. So, it seems that the estimation is possible.


texts: Remove noise from distance calculated from accelerometer data

texts: I got distance calculated from accelerometer raw datas using double integral accelerometer.I attached the image below.But it shows noise with it.Please help me to remove this noise.


texts: How can I compute a time-frequency cross-spectrum in MATLAB?

texts:
MATLAB has a spectrogram function for the time-frequency analysis of a single signal. It also has a cpsd function for estimating the cross-frequency spectrum for two signals. However, cpsd averages across windows, collapsing the time axis into a single estimate.

Is there a function in this same family that does not average, but returns a time-frequency cross-spectrum instead?

Because I want to use this in a step-by-step tutorial for teaching purposes, I'd like to avoid the following two possible solutions:

The cohgramc function from the Chronux toolbox (uses a multitaper spectral estimation method I don't want to get into)
The wcoher function from the Wavelet toolbox (uses wavelets, idem)

Both of these methods return nice time-frequency cross-spectra, but I would like just to have a basic version with the familiar windowing parameters that spectrogram and cpsd use. Does this exist?


texts: Decoding of binary signal from a temperature sensor

texts:
I have the following signal from a temperature sensor (broadcasts on 433.92 MHz, apparently as ASK).

I cannot for the life of me extract the temperature data.

I've tried reading off the bits in so many different ways (mostly by looking at the pulse widths) then searching the data for the temperature info.

For example:

This corresponds to a temp of 21.0.

I tried to read each pulse after the first 4 big pulses - that gives 37 bits:

1000111110010010110001100011111111000

Then I tried searching just for the 21 part. So I tried searching for 21, 61, 71 (in case the designer was adding 40 or 50 degrees to avoid negative numbers). I tried searching for the 2 and then the 1 bit shifted by 4. I tried negating all the bits.  I tried searching in reverse.

Is it possible this is not pulse width modulation?  Is it possible there are not 37 bits here?


texts:
I'm working on some edge detection algorithms that I want to evaluate them. I want to know what are standard ways to evaluate them that check does them work better that old ones or no.

thank you for helping


texts: Keeping track of units for spectral energy of discrete signals

texts:
The energy of a continuous signal $x(t)$ recorded between $t=0$ and $t=T$ (namely $x(t \notin [0, T]) = 0$) is defined as

$$E = \int_0^T |x(t)|^2\, dt.$$

In most signal processing texts I met, the formula for the energy of the same signal sampled at $N$ regular steps separated by $\Delta t$ is given as

$$E_N = \sum_{n=0}^{N-1} |x_n|^2,$$

which implies an implicit normalisation of the signal.
As I would like to keep track of the physical units, I am inclined to use

$$E_N = \sum_{n=0}^{N-1} |x_n|^2 \Delta t.$$

Now, Parseval's identity gives, in the continuous case,

$$E = \int_0^T |x(t)|^2\, dt = \int_{-\infty}^\infty |\hat{x}(f)|^2\, df,$$

where $\hat{x}$ is the Fourier transform of $x$.
This leads to define the /energy density/ as

$$e(f) = |\hat{x}(t)|^2.$$

I would translate this in the discrete case as

$$E_N = \sum_{n=0}^{N-1} |x_n|^2 \Delta t = \Delta t^2 \sum_{k=0}^{N-1} a_k^2 \Delta f,$$

where $\Delta f = 1/T$, and the $(a_k)$ are the Fourier amplitudes and such that

$$\forall \; k \in \{0, N-1\}, \, \sum_{n=0}^{N-1} x_n e^{-2i\pi k \frac{n t}{T}}
                                      = a_k e^{i \phi_k},$$

Finally, I would define the discrete energy density as

$$e_N(f) = \Delta t^2 |a_k|^2 \text{ for } k \Delta f \leq f < (k+1) \Delta f.$$

Does this sounds sane to practitioners of the field?


texts: Why use parametric based estimation methods - confusion regarding terms

texts:
Using the probability density function (pdf) we can estimate an unknown parameter using methods such as Maximum Likelihood estimation. If the pdf is not available, then Least Squares can  be used. Other methods for pdf unavailable situations are Least Mean Squares.

Then there are other methods which are called as heuristic based approaches such as particle swarm optimization, genetic algorithm, ant colony optimization. These are also applied to find an unknown parameter without using the pdf. This is quite a long post, so  a big thank you and I really appreciate the patience in taking the time out to read and understand my concerns. My questions are:

1) What is the difference between parameter estimation and optimization?

2) Is there a rule of thumb when to use estimation theory and optimization?

Many research articles and text books use these two terms interchangeably based on my understanding. For example, the abstract in the paper titled, "Parameter estimation with bio-inspired meta-heuristic optimization: modeling the dynamics of endocytosis" which is given below:

We address the task of parameter estimation in models of the dynamics of biological systems based on ordinary differential equations (ODEs) from measured data, where the models are typically non-linear and have many parameters, the measurements are imperfect due to noise, and the studied system can often be only partially observed. A representative task is to estimate the parameters in a model of the dynamics of endocytosis, i.e., endosome maturation, reflected in a cut-out switch transition between the Rab5 and Rab7 domain protein concentrations, from experimental measurements of these concentrations. The general parameter estimation task and the specific instance considered here are challenging optimization problems, calling for the use of advanced meta-heuristic optimization methods, such as evolutionary or swarm-based methods.

However, in signal processing, optimization is rarely combined or taught in conjunction with parameter estimation. For example, in the book by Steven Kay titled, "Fundamentals of Statistical Signal Processing, Volume I: Estimation Theory" never mentions optimization as another method to do estimation. However, Gradient Descent is an optimization algorithm which uses the derivative of the function and equates to zero. If this is the usual way of doing optimization, then Maximum Likelihood estimation also find the derivatives with respect to the unknown parameter using the log-likelihood function, which are equated to zero to obtain the estimates. This brings to my last 2 questions which are:

3) Is MLE an optimization or estimation technique?

4) Heuristic approaches such as particle swarm etc do not find derivatives to obtain the minima or maxima of the objective function. Then why are they called optimization methods if they are not optimizing the cost function in the usual way which is taking the derivatives and equating them to zero?


texts: What is the best method to estimate the frequency(PSD) for noise signal

texts:
I’ve been trying to estimate the frequency of a signal I obtained at 1000Hz sampling frequency. The dominant frequency is expected to be not more than 4 or 5 Hz. I’ve estimated the PSD using autocorrelation method however for some signal it seems to noisy and it’s difficult to find the dominant frequency. I’ve tested the method for 60 signals and the output was not as expected (the frequency goes up and down when it should either increase or decrease according to the process).
I shall be grateful for any suggestions
The details of the signal can be found in this post: How to estimate PSD, and time delay of a random signal?

here's the code I used

%% estimate the power spectral density, where the spectrum is the FFT of the autocorrelation sequence.

for i=1:numel(files)
   N=length(Rxx{1,i}(1:4000));
   nfft{i} = 2^nextpow2(length(Rxx{1,i}));
   % Compute Fourier transform of x using nfft
   Xxx{i} = fft(Rxx{1,i}(1:4000),nfft{1,i});

   % Frequency vector

   fs=1000;
   F{i}= 0 : fs/(nfft{1,i}-1) : fs;

   % Powerspectral density

   Pxx1{i} =2* abs(Xxx{1,i}).^2/N;
   [mx{i},ind{i}] = max(Pxx1{i});
   maxxfreq{i}=F{1,i}(ind{i});
   figure
   plot(F{i},Pxx1{1,i}), grid
   axis([0 10 0 max(Pxx1{1,i})])
   xlabel('Frequency')
   ylabel('Power')
   title('power spectrum')
end


texts:
In estimation problems, we may use Cramer-Rao Lower Bound (CRLB) to evaluate the best performance. But if there is no unbiased estimator can attain CRLB, what is the meaning of CRLB?

To clarify the question, I present a simple question here:

$\alpha$ is selected as the evaluating indicator of system $A$. We can obtain the CRLB of $\alpha$, but there is no estimation $\hat \alpha$ which can reach CRLB. Is it reasonable to use the CRLB of $\alpha$ to evaluate the performance of system $A$.


texts: Understanding index transformation in derivation of Fourier transform for sampling rate reduction

texts:
Was going over some notes regarding deriving fourier transform equation for Sampling Rate Reduction. Reference to Notes from below link https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-341-discrete-time-signal-processing-fall-2005/lecture-notes/lec05.pdf or from Book Discrete-Time Signal Processing by Alan V. Oppenheim (2nd Edition), equation 4.75.
$$r = i + kM$$
I am lost as to how this is obtained. I understand that every $M-1$ samples are dropped from original sampling results; but still cannot understand how this expression for $r$ is derived.
Could someone help me understand this?


texts:
I am working on a speech synthesis model and I am looking to evaluate my synthesized speech. I found that most people use the Mel Cepstral Distortion (MCD) which can be calculated by the formula:

$$\frac{10\sqrt{2}}{\ln10}\frac{1}{T}\sum_t\sqrt{\sum^{25}_i 2||mc(t,i)-mc_{synth}(t,i)||^2}$$

I have ground-truth speech and the synthesised version so I calculate the MFCCs for both (taking 25 coefficients) and then apply the formula. The result I get is around 300, which seems orders of magnitude larger than what I should get. I tried doing cepstral mean normalization which brings the number down to around 30 but I notice that most of the time this number is <10. The speech I synthesize is not so bad so I must be doing something wrong. Does anyone have any ideas?

P.S. The way I produce the speech ensures that it be aligned with the original(more or less). I wonder if a slight misalignment could cause this issue and if so should I use DTW to align the audios?

Edit
Also If anyone knows of a library that calculated MCD when given an audio file then I could use that to compare my results.


texts: integral with vectoric varying coeficient

texts:
i have a basic function exp(-x.^2).*log(x).^2 which i integrate in a certain interval.
i want to multiply my basic function with a vectoric coefficient called coef_vec that varies with the interval.
so if the integral is at 5 my basic function whould be multiplied with coef_vec(5).
i know that its som how turning the integral into a loop.
Is it possible in matlab?
Thanks.

coef_vec=linspace(1,10,100)
fun = @(x)coef_vec*exp(-x.^2).*log(x).^2;
q = integral(fun,1,10);


texts: How to calculate EVM in %age of an Equalized Constellation in 16QAM?

texts:
I have an equalized constellation for 16 QAM. The constellation is equalized by LMS algorithm.

I want to calculate the EVM for the equalized constellation. How can I calculate this so that the EVM lies within the threshold limit?


texts: image processing find liquid level (only with images processing, no AI)

texts: I want some ideas to get the level of a water/liquor in a cup. i tried many ideas (contours, edges,...) but nothings is working. So any ideas that i can explore.


texts:
I've implemented 2 filters in Python I would like to know if they look OK or not.. I've implemented an lowpass FIR Hann Filter and an lowpass  IIR Chebyshev type 1 filter. My plots look like the following: Time amplitude and frequency spectrum:
Hann Window:

Cheby 1:

Is there something that I did wrong, that I should improve??


texts: More Simultaneous Dynamic Range with Fixed Point or Floating Point?

texts:
What data path would have more simultaneous dynamic range: 32 bit fixed-point or 32 bit floating-point?  Why?
To clarify "simultaneous dynamic range": This is the ability to discern strong and weak signals at the same time, while dynamic range is the total range between between the weakest signal (sensitivity to still meet a performance metric) and strongest signal (saturation or some other decrease in a performance metric such as 1 dB compression, clipping, etc). One example where we would be concerned with simultaneous dynamic range is in an FFT where we have both weak and strong tones simultaneously at two different frequencies and we want to be able to discern both in the same FFT result.
Our vision and hearing are good examples of the difference between simultaneous dynamic range and dynamic range: see https://en.wikipedia.org/wiki/Dynamic_range
Please preface your answer with spoiler notation by typing the following two characters first ">!"


texts: Unclear inverse Z-transform of $G(z) = \frac{1-p}{z-p}$

texts:
In this paper on page 5 equation (10) is supposed to be the reverse z-transform of equation (5) on page 4.

$$\frac{U(z)}{\bar{U}(z)} = G(z) = \frac{1-p}{z-p} \quad \leftrightarrow \quad u(k) = \bar{u} \cdot (1-p^k)$$

Hint: This is related to settling time somehow...

Questions: Why is suddenly the dependence of $\bar u$ on k neglected? Second how is this transform calculated? I would have done it like this:

$$G(z) = \frac{1-p}{z-p} \quad \leftrightarrow \quad u(k) = \bar u(k)*(1-p) \cdot p^{k-1} \cdot \epsilon [k-1] $$
with $\epsilon [k]$ being the step-function and $*$ being convolution.
What am I missing right here?


texts: increase the # of points in a DFT, increase the processing

texts:
I have a question which is closely related to this one:
FFT Processing Gain

^that discussion is a bit general so I want to ask a very objective question to see if I can apply that knowledge:

If I collect one million time samples and perform a one million point DFT, roughly what DFT processing gain (in dB) improvement can I expect to achieve in pulling a weak spectral component up above background noise in comparison to a 100 point DFT?

I guess that answer is 100,000. isn't it?

we have 9999910 more bins.


texts: Does frequency shifting double needed bandwidth?

texts:
Suppose we have a low pass signal and it's spectrum is like this:

If we define bandwidth as the difference between signal minimum and maximum frequencies, above picture says that the signal has a bandwidth of $B$.

If we shift this signal to frequency $f_s$ by multiplying it with $cos(f_st)$, we get this spectrum:

So now signal bandwidth is : $f_s+B-(f_s-B)=2B$
. Is it correct to say this signal shifting doubled signal bandwidth ?

Suppose we want to transmit analog human voice over $f_s$ frequency. Before shifting, needed bandwidth was 4 KHz, but after shifting we need 8 KHz of bandwidth, is it true?


texts: How do I take the real part of this bandpass filter system's output?

texts:
I'm stuck on a final step in this problem. Essentially, there are the two systems above, which we'll call System 1 (Fig. 4.26, with ideal lowpass $H(jw)$) and System 2 (with $H_1(jw)$). The question proposes that the output y(t) of System 2 is identical to that which would be obtained by retaining $\Re\{f(t)\}$ of System 1.

I have a couple questions -

(1) Why do we need to take the real part of system 1 and not system 2? Aren't they both already bandpass filters?

(2) I solved out answers for $F(jw)$ and $Y(jw)$. $H_1(jw)=H(jw)$ is assumed (they seem to be the same):

$$F(jw)=H(j(w+w_c))X(jw)\\Y(jw)=\frac{1}{2}(H(j(w-w_c))X(jw)+\frac{1}{2}H(j(w+w_c))X(jw)$$

I'm relatively confident this answer is correct, but I'm unsure of how to take the real part of $f(t)$. Can I take the real part of $F(jw)$ and get it to look like $Y(jw)$?

Thank you!


texts: What equation describes black alpha on a white image?

texts:
What equation best describes the alpha content of a black colored pixel applied to a white pixel when measuring the resulting pixel intensity?

For instance

given a white pixel: argb : 255, 255, 255, 255
drawing over it with a black pixel: argb : 78, 0, 0, 0
the result is argb : 255, 50.2, 50.2, 50.2

Measuring the pixel's intensity 50.2 should relate an alpha level of 78 when testing for black.

After trying for it, I settled on a rough formula ~>  A = 1 - (I / 255) ^ 2.193

Here A = alpha, I = intensity. It could be  1 - I ^ 2.193  if the values for I were in the range 0 - 1. This is just a gamma function subtracted from one to orient the values correctly. For white alpha pixels applied to a black image the formula would be  I ^ 2.193.
This may not be near the solution but I can't dream it up. I may have heard of this equation using a power of 2.2, maybe not. Its results are okay, but then again I also liked the results of a linear equation, happily adding 1 level of alpha for each 1 level of intensity less than 255 (white.)

I would really love to read about the science behind this alpha relationship from one of you!

EDIT ...
Thanks to Emre my question is answered. And now that I have the solution I have added some figures to turn it into an example...

3 images ~> a sphere separated into a white part and an alpha part

Images obtained using Gamma 2.2 result and Linear result
re-applied to white layers, respectively

Graph from Wikipedia demonstrates the difference between sRGB (standard red green blue) and Gamma 2.2. Here sRGB is the red line plotting the intensity function, and Gamma 2.2 is a black dashed line drawn below the red line. Not much difference

Thus, A = 1 - I ^ 2.2, is nearly correct choice


texts: inverse continuous wavelet transform and [Parm] in cwtft

texts:
what is 'parm' means when you set the name of wavelet function in cwtft or icwtft. wave = {wname,[7.6]}. also can I change Fb and Fc when I use 'morl' function in cwtft or icwtft transform? and If not, then how can I reconstruct my signal with cwt transform? cause cwt let me to select optional value for fb and fc (cmorfb-fc). Matlab doesn't have direct function for inverse wavelet transform.

N = 1024;
t = linspace(0,1,N);
y = sin(2*pi*8*t).*(t<=0.5)+sin(2*pi*16*t).*(t>0.5);
dt = 0.05;s0 = 2*dt;ds = 0.4875;NbSc = 20;
wname = 'morl';sig = {y,dt};sca = {s0,ds,NbSc};
wave = {wname,[7.6]};
cwtsig = cwtft(sig,'scales',sca,'wavelet',wave);
sigrec = icwtft(cwtsig,'signal',sig,'plot');


texts: Brute forcing an aperiodic s-shaped signal to be periodic by mirroring it before performing FFT

texts:
I have an aperiodic signal of an s-shape in the time-domain that I would like to filter and calculate the derivative of using the FFT. The jump at the end of the s-shape has, of course, a strong influence on the obtained amplitude spectrum. I am trying to eliminate the influence of the jump without giving less weight to the beginning and the end of my measurement by applying a window function.
Hence, as a first shot in the dark, my idea was to "brute force" the signal to be periodic by mirroring the s-shape at the end of the measurement, yielding a "bell curve". This approach yielded significantly improved results in the filtered signal and achieved a good approximation for the derivative. I am quite glad that this approach works and it helped me make a lot of progress recently.
However, I am still puzzled about why this approach works in the first place. Shouldn't the mirroring operation on my input signal significantly influence the output? Is there a theoretical reason for this approach working that I have overlooked?
Thank you in advance for all your thoughts and explanations.

Edit: I included a simplified example of what I did to brute force the periodic signal. As can be observed, the orange curve (ideal measurement without measurement noise) has an s-shape and ends abruptly at a certain value. I mirrored the curve around its last value to force a periodic "bell curve".


texts:
I generate a sinus which duration is 15ms and frequeuncy of 13KHz. Is its bandwidth is (1/15ms) ? Or in other words, BW = 66.6Hz?
I ask that because I have two freqs in my system: 13K & 13.1K.
I know that they are seperated by 100Hz. And as the tone I generate have a lower duration I think it spreads into its friend area.


texts: Empirical Distribution White Noise Tests

texts:
All common tests for testing if a time series is white noise are based on common distribution assumptions from which inference is made that a process is white noise.

However, in the case for most time series the underlying distributions do not follow traditional distributions (gausian etc). For this reason I would like to know if any white noise tests exist which do not use preconcived distributions and observes main white noise assumptions (finite variance, serially uncorrelated ( independent / statinonary) and zero mean).

Using density spectrum as to see if the density plot produces a flat line through FFT is not possible as the series is non stationary.


texts: How to calculate arbitrary phase shift in discrete signal?

texts:
When I have digital audio signal, represented in samples, I can easily phase-shift the signal by 180° by simply inverting the value of each sample.

But what if I want to phase shift an arbitrary voice audio signal by say +90° or -90°?

How do I transform an arbitrary, discrete signal by phase-shifting it by an arbitrary phase angle?


texts:
I am aware that an ideal low-pass filter in both continuous time and discrete time has a $\mathrm{sinc}$ impulse response. What would the impulse response of an ideal high-pass or band-pass filter look like (assuming that it is real)? My intuition says that it would be some sort of superposition of shifted $\mathrm{sinc}$ functions but I am not quite sure.
Thanks in advance.

EDIT:
Here is my attempt at deriving the impulse response $h(t)$ for a continuous-time ideal high pass filter with a zero phase characteristic.

The frequency response in this case can be written as $H(\omega) = u(\omega - \omega_c) + u(-\omega -\omega_c)$ where $u$ is the unit step function and $\omega_c$ is the filter cut-off frequency.

Using the Fourier transform pair:

$$u(t) \leftrightarrow \frac{1}{j\omega} + \pi \delta(\omega)$$

we can exploit the duality property to obtain:

$$\frac{1}{jt} + \pi \delta(t) \leftrightarrow 2\pi u(-\omega)$$

which implies (from linearity):

$$\frac{1}{j2\pi t} + \frac{1}{2} \delta(t) \leftrightarrow u(-\omega)$$

Additionally we obtain from the time reversal property and the scaling property of the delta function:

$$-\frac{1}{j2\pi t} + \frac{1}{2} \delta(t) \leftrightarrow u(\omega)$$

Applying the inverse Fourier transform to:

$$H(\omega) = u(\omega - \omega_c) + u(-\omega -\omega_c) = u(\omega - \omega_c) + u(-(\omega +\omega_c))$$

and using the linearity property, the frequency shift property, and the two Fourier transform pairs I wrote above we obtain:

$$h(t) = e^{j\omega_c t} \{ -\frac{1}{j2\pi t} + \frac{1}{2} \delta(t) \} +  e^{-j\omega_c t} \{ \frac{1}{j2\pi t} + \frac{1}{2} \delta(t) \} $$

and I don't know where to go from there (specifically, I don't know how to handle the delta functions that popped up).


texts: Has this 2D filter for enhancing circular dots in images a name?

texts:
I came across this 2D filter for enhancing circular dots in images, for example to enhance a dot with a diameter of 5 pixel, the filter is:

$\frac{1}{336}\left( \begin{array}{ccccccc}
0 & 0 & −21 & −21 & −21 & 0 & 0\\
0 & −21 & 16 & 16 & 16 & −21 & 0\\
−21 & 16 & 16 & 16 & 16 & 16 & −21\\
−21 & 16 & 16 & 16 & 16 & 16 & −21\\
−21 & 16 & 16 & 16 & 16 & 16 & −21\\
0 & −21 & 16 & 16 & 16 & −21 & 0\\
0 & 0 & −21 & −21 & −21 & 0 & 0 \end{array} \right)$

Has this filter a name? Like Sobel or Scharr.

What is the rationale behind its coefficients?


texts: Sketching Phase Spectra Using Group Delay and Magnitude Spectra Informations

texts:
I have only magnitude spectra and group delay information and I need to sketch phase spectra from this information. For example, group delay is given like this: $\tau_{g}(\omega) = c$ where c is a constant value.

I know the group delay is the derivative of minus phase function of the system. In this case, phase function can be written likse this: $\beta(\omega) = - c \omega + constant$, but how to determine the $constant$ here? Is it possible to find phase from these information?


texts:
I have a bunch of phone interviews where there is large sound volume difference between two voices in some of the interview audios, because they were recorded only on one side of the phone. May I ask what is the preferred procedure for reprocessing these audios so they are fit for downstream machine learning feature extraction and modelling tasks while the characteristics of the audio will not be sacrificed?

After some reading on audio compression, normalisation, and levelling, e.g. here, I have to say I am still not sure what to do next. I have seen simple minmax scaling being suggested for normalising the waveform amplitude. I have also been suggested to normalise the audio to a target amplitude (e.g. normalize in pydub.effects or ffmpeg loudnorm/dynaudnorm), which is loudness normalisation if I am not mistaken. Should I use a compressor or automatic gain controllor? Descript has a auto-leveling feature that seems to be useful, though I can't find any technical info on it.

My current plan, which is the simplest one, is to segment the audio streams to speaker turns, then normalise each speaker turn to (-1, 1) by minmax scaling. How does this sound? Btw any suggestions on declipping? Some of the audios have been clipped. Thanks!


texts: I know that in the image acquisition stage, after obtaining the analog image from the sensors, it is sampled and quantized. How the Nyquist sampling is achieved? The sampling frequency must be at least twice the highest spatial frequency (measured by pixels per inch) in the image. I know that the pixel per inch (ppi) is related to screen or printers, then how will the spatial frequency (measured in pixels per inch) be calculated in order to achieve the Nyquist sampling condition?


texts: Given the Graph of a Fourier Series $\sum c_k e^{2\pi ikx}$ Find the Graphs of $\sum c_{3k} e^{2\pi ikx}$ and $\sum (c_k)^2 e^{2\pi ikx}$

texts:
Define a 1-periodic function on $\mathbb{R}$ by:

$f(x) :=$
$\left\{\begin{matrix}
1 & if & 0<x<\frac{1}{10}\\
0 & if & \frac{1}{10}<x<1
\end{matrix}\right.$

with Fourier series $f(x) = \sum_{-\infty}^{\infty}c_k e^{2\pi ikx}$.

I'm trying to find the graphs of the following two Fourier series:

$\sum_{-\infty}^{\infty}(c_k)^2 e^{2\pi ikx}$ and $\sum_{-\infty}^{\infty}c_{3k} e^{2\pi ikx}$.

Basically my strategy with the others has been to find a way to get these Fourier series into the form $a\sum_{-\infty}^{\infty}c_k e^{2\pi ik(bx)}$ for $a,b\in\mathbb{C}$.  But I haven't been able to do it with these, hopefully someone can help, thanks.


texts: Capacity and BER as performance of transmission system

texts: We study the performance of the transmission system by channel capacity or BER/SER. If the system performance is studied as BER/SER, does it make sense to study a channel capacity?


texts: Negative group delay and envelope advance

texts:
I am having a doubt reading about delays in signal processing.

Let there be an input to a LTI system with frequency response $H(f)$, given signal $x(t) = a(t)\cos(2\pi f_ot)$, where $a(t)$ is a narrowband envelope and of bandwidth $B$ Hz, such that $f_o \gg B$.

The output $y(t)$ is given by $$y(t) =\lvert H(f_o) \rvert a\left(t - \tau_g\right)\cos\left(2\pi f_o\left(t - \tau_p\right)\right)$$ here $\tau_g$ is the group delay and $\tau_p$ is the phase delay at frequency $f_o$.

My question

It is not unusual to have positive gradients in the phase response and hence have a negative group delay which seems to suggest that the envelope is advanced in time, so the input appears at the output prior to being applied!! This of course should not happen in practice so what are we missing here. Can somebody explain this. Is there an issue with the derivation? But this is a well known equation.

Note:I have read the research article and other questions  that conclude with the notion of "filter being able to predict values from past" , I am not convinced by those. In a causal LTI practical system I am sure, an input will appear at output only after it is applied at input.


texts: How to remove constant accelerometer velocity offsetting?

texts:
For quite some time I have been working on a project and got stuck recently with a problem considering integrating vertical acceleration from a legendary MPU6050 to get vertical velocity.
What I have been struggling with is the fact that velocity does not ever come back to 0. After every sequence of movement it just gets more and more off. It doesn't drift linearly anywhere, just stays constant, but wrong. It kind of seems, like the accelerometer was more sensitive detecting the acceleration in one direction than in the opposite one.
What may cause the problem? Is there any way to fix it with software? Switching to an IMU like BNO055, that is capable of doing the integration maths 'in chip' isn't a possibility right now. Thanks for all the help in advance.
Have a nice day.


texts: Spectral centroid range between 0.45 to 0.5, almost doesn't react to mic input

texts:
I am implementing some feature extractors in Swift for an application. One of these features is Spectral Centroid. For some reason I keep getting values ranging between 0.45 and 0.5, and these don't really reflect what I'm playing through the microphone. I can see why it's close to 0.5 when there is nothing playing as the centre of mass is around the middle of the spectrum. I have implemented the FFT like so using the Accelerate library:

func FFT(buffer: [Float]) -> [Float] {

    var real = [Float](buffer)
    var imaginary = [Float](count: buffer.count, repeatedValue: 0.0)
    var splitComplex = DSPSplitComplex(realp: &real, imagp: &imaginary)

    let length = vDSP_Length(floor(log2(Float(buffer.count))))
    let radix = FFTRadix(kFFTRadix2)
    let setup: FFTSetup = vDSP_create_fftsetup(length, radix)

    vDSP_fft_zrip(setup, &splitComplex, 1, length, FFTDirection(FFT_FORWARD))

    //Extracting the magnitudes: real^2 + imag^2
    var magnitudes = [Float](count: buffer.count, repeatedValue: 0.0)
    vDSP_zvmags(&splitComplex, 1, &magnitudes, 1, vDSP_Length(buffer.count))

    var normalizedMagnitudes = [Float](count: buffer.count, repeatedValue: 0.0)
    vDSP_vsmul(sqrt(magnitudes), 1, [2.0 / Float(buffer.count)], &normalizedMagnitudes, 1, vDSP_Length(buffer.count))

    return normalizedMagnitudes

}

The Spectral centroid algorithm that I've implemented looks like so:

func spectralCentroid(fft: [Float]) -> Float {

    var numerator: Float = 0;
    var denominator: Float = 0;

    var nyquist: Int = fft.count/2;

    for (index, bin) in enumerate(Array(fft[0..<nyquist])){
        numerator += (abs(bin)*Float(index))
    }
    denominator = sum(Array(fft[0..<nyquist]));

    return isnan(numerator/denominator) ? 0 : (numerator/denominator)/Float(nyquist);
}

I am also using this utility function that I've made to convert from AVAudioPCMBuffer to a regular float buffer:

func convertBufferToFloat(buffer: AVAudioPCMBuffer) -> [Float]{

    for var i: Int = 0; i < Int(buffer.frameLength); i++ {
        bufferInFloat[i] = buffer.floatChannelData.memory[i]
    }

    return bufferInFloat
}

Any ideas?


texts: What is the Effect of Multiplying a Function by the Unit Impulse Function in the Frequency Domain?

texts:
I know about the the shifting property of the impulse function in the time domain as can be seen in equation $(1)$.

$$
\int_{-\infty}^{\infty} f(x)\delta(x - a)dx = f(a)\tag{1}
$$

But what is the effect of multiplication of a function by the impulse function in the Frequency domain? I.e

$$
X(\omega) = \delta(\omega - \omega_0)\cdot H(\omega)
$$


texts: How do I apply a binary mask and STFT to produce an audio file?

texts:
So here's the idea: you can generate a spectrogram from an audio file using shorttime Fourier transform (stft). Then some people have generated something called a "binary mask" to generate different audio (ie. with background noise removed etc.) from the inverse stft.

Here's what I understand:

stft is a simple equation that is applied to the audio file, which generates the information that can easily be displayed a spectrogram. By taking the inverse of the stft matrix, and multiplying it by a matrix of the same size (the binary matrix) you can create a new matrix with information to generate an audio file with the masked sound.

Once I do the matrix multiplication, how is the new audio file created?

It's not much but here's what I've got in terms of code:

from librosa import load
from librosa.core import stft, istft
y, sample_rate = load('1.wav')
spectrum = stft(y)
back_y = istft(spectrum)

Thank you, and here are some slides that got me this far. I'd appreciate it if you could give me an example/demo in python


texts: Does the FFT size matter in OFDM demodulation?

texts:
The DFT size in OFDM demodulation is usually matched to the DFT size in the modulation process. This makes modulation/demodulation simple where each FFT bin (i.e., sample) represents one symbol. What is the impact of taking an arbitrary larger FFT size during the demodulation process (assuming properly sampled based on new DFT size)? Intuition seems to lead you to think that the underlying symbol is now spread across multiple bins. Can you use a larger FFT size and still demodulate the data?
EDIT: sample rate clarification


texts: Why do we assume the matrix of impulse responses to be a Toeplitz matrix during deconvolution

texts:
$y(n)$ = output signal
$x(n)$ = input signal
$\mathbf H$ = system response as a toeplitz matrix

$$\mathbf H = \begin{bmatrix}h(0)&&&\\h(1)&h(0)&&\\h(2)&h(1)&h(0)&\\\vdots&&&\ddots\end{bmatrix}$$

I understand that $\mathbf H$, with its transposable (orthonormal) properties, makes it easy achieve $x(n)$ when we only know $y(n)$ during deconvolution. But how did we just assume $\mathbf H$ to be of this shape. Why not some other matrix shape when doing deconvolution? Is there a certain reason for this?


texts:
I am working on a program that will be able to tell when a musical note is played in audio and what that note is (ie. guitar or piano). You can assume can assume any audio used for the program will be relatively clear. For example, here's a song i think i should be able to extract the notes out of https://www.youtube.com/watch?v=zqDIcNl27KQ. I know this isn't necessarily a trivial task but i feel like i'm partially there... i recorded myself plucking a few strings on the guitar in succession and the program was able to correctly identify the notes and when they were being played.

Basically i'm breaking down the audio into 2048 byte/short chunks of data as sample size (i think this is the standard sampling size) with half of overlap between chunks. The audio file is standard 44100 mhz wav. So where i'm at now i've managed to get the frequencies present in these chunks and their presence, along with the overall volume of the chunk.

So far i've messed around with a few things... slope of volume of surrounding chunks (ie. an increase in volume is usually associated with a note being played) then looking at what kind of slopes are associated with a note being played and i've also done something where i merge the "weights" of surrounding chunks to normalize the data in a way. For example, let's say i have a chunk where the primary frequency is 100, the chunks next to it have frequency at the second position. So i would do (1 + 2 + 2) / 3 to get the "presence" of the frequency over the span of those 3 chunks, obviously in this example a lower number would indicate a larger presence. When you filter the chunks by minimum volume or minimum volume slope you don't have to worry about irrelevant chunks.

Anyway, before i delve too much into trying to find my own algorithm i was wondering if there were any algorithms that might do what i'm looking to do or at least any input on a direction i should look to go in.


texts: Information theory vs system theory ( commented in Determining linearity, causality, memory, and time invariability from a picture of the signal)

texts:
I have seen this question :

At the comment asked about :

  Is this "information theory" or "systems theory"? – The Photon

So i liked to know why this comment asked? Why the system theory vs information theory

I am newbie about this topic and asked here for better saving time and ...

Thanks for your attention.


texts: Hand written DFT vs MATLAB FFT has flipped conjugates?

texts:
I had to compute the DFT of a signal with 5 points with a hand-written method and using MATLAB's FFT just to see if they are equal. Taking the absolute value of both gives the same spectrum, however the conjugates are in a different order for both. Why is this?

values using handwritten DFT, negative conjugates first

values using MATLAB FFT, positive conjugates first

The code I used is shown below

Now we compute the DFT of the finite sequence to show that DFT is
actually a sampled version of the DTFT.

N=5;
W=exp(-1i*2*pi/N); %the complex term W_N defined in lecture 2;
DFTmatrix = W.^((0:N-1)'*(0:N-1)); %the DFT matrix of size N
%Multiply the DFT matrix with the time-domain samples to get DFT
DFTofTruncatedSampledSignal = DFTmatrix*sampledsignal.';

Task 5:
FFTSpectrum =fft(sampledsignal,N)'; %MATLAB fft function to compute DFT


texts: Adaptive Delta Modulation: Logic for step size control at receiver

texts:
I read that in adaptive delta modulation, we have a block for step size control  (diagram below) which takes into account the one bit quantizer output in a feedback loop and modulates it, the intent being to modulate step size to keep up with fluctuations in the message signal. I had a few doubts in this regard.
1] How does it do that? The 1 bit quantizer output is either +delta or -delta, and based on it, how is it possible for the block (Logic for step size control) to know whether to amplify delta or reduce delta to keep up with variations of the message signal?
2] At receiver side, we again have the same block for modulating the received decoded bit (diagram 2). Now, how does the logic block at the receiver side align with the one at the transmitter side? That is, after decoding the received bit as +delta or -delta, how does the receiver know whether to reduce it or amplify it as per the same logic used in transmitter side?

Any insights or references would be appreciated.


texts:
I understand that EVM is a root mean square of error vectors. If I have transmitted symbols and received symbols (once equalized), taking a root mean square would give me EVM. I believe this is actual EVM (we are using actual tx symbols and mapping them to equalized received symbols and then computing EVM).
How does a signal analyzer (which doesn't know tx symbols) computes EVM?
Does it calculate the EVM  of each equalized received symbol with a closest ideal symbol on the constellation and then average it out to give final EVM value?


texts: How to perform a time domain shift in the frequency domain without zero padding

texts:
Apologies in advance if my question doesn't make sense. I'm not the most fluent person in signal processing.

I have an array of time domain values that I would like to apply a time delay to by computing the fft then apply the Fourier transform
$f(t - \tau) = F(\omega)\exp(-i \omega\tau)$ and then compute the inverse fft to get my delayed signal.

My problem is that the delay is very large (three times further than the range of my original signal) so in order to get the delayed signal I have been zero padding my original signal by a significant amount which greatly increase the computation time.

Is there a better way to compute the delay using Fourier transform without the need to zero pad?


texts:
i have the following metric for calculating the SNR for my predictions:

i basically dont calculate signal to noise but signal to error. x is my prediction and y is the true signal.
When i have an increase of 1 decibel, how can i express this in percent?

e.g  i have increased my snr from 7.3 to 10.5. I would like to express the improvement in percent


texts: How might I go about detecting phase changes in a sine wave of a certain frequency?

texts:
I want to detect occasional instantaneous changes in the phase of a sine wave.

I have a signal that is a sine wave whose frequency is in the kHz range and experiences random changes in its phase. I want to detect these phase changes and count the occurrences. Ideally, I would also be able to extract some approximate phase change in degrees for each occurrence. How might I go about that?

I implemented Jason R's suggestion in Python:

# generating a 30KHz sine wave sampled at 500KHz with a pi/2 phase shift halfway through the signal
F = 30e3
Fs = 500e3
t = np.arange(0, 1e-3, 1/Fs)
S = np.append(np.sin(F*2*np.pi*t[:int(len(t)/2)] + 0), np.sin(F*2*np.pi*t[int(len(t)/2):] - np.pi/2))

S_analytic =  hilbert(S) # calculating the analytic signal

def GetRealImagArray(Array):
    ImagArray = np.array([num.imag for num in Array])
    RealArray = np.array([num.real for num in Array])
    return RealArray, ImagArray

R, I = GetRealImagArray(S_analytic)
phi = np.arctan2(I, R)
f = phi[1:] - phi[:-1]

I then get the following by plotting the signal and FM discriminator:

The large positive spike indicates the change in phase as required in my question. What is the cause of the downward spikes at the minima of the sine wave? Is this expected behaviour or an error in my Python implementation?


texts: What is about the circular convolution in OFDM

texts:
In an OFDM system, serial-to-parallel conversion for data is done, then the DFT is performed and then adding the cyclic prefix (CP).

My question is related to that step of adding a CP. As I know, adding the CP is
My question, if $H$ is the vector of $y$ in frequency domain, "$H = Fy$", so Can we diagonalize $H$ by left-right multiplying by proper DFT?  Which mean $A = F \, H \, F^H$ and $A$ is a diagonal matrix of $N \times N$ ??   Does that right in OFDM? And what's about after removing the CP when performing DFT operating in receiver side, will this propriety of circular convolution will be kept?

thank you


texts: If humans can only hear up to 20 kHz frequency sound, why is music audio sampled at 44.1 kHz?

texts: I read in some places that music is mostly sampled at 44.1 kHz whereas we can only hear up to 20 kHz. Why is it?


texts: Is there a difference between Image Alignment and Stereo Rectification for stereo correspondence or matching?

texts:
As far as I know,
Image alignment just finds the best fit given two images of the same scene.

Whereas Image rectification, with regards to stereo vision, warps the images so that the epipolar lines are all on the same level. Essentially all common pixels between the two images are warped to be on the same y axis.

My question is, what is the difference between Image Alignment and Image Rectification, given a pair of images, when doing stereo correspondence?

If I were to find the disparity between two images, how is image alignment different to image rectification?


texts: Relating phase shift to the ROL/ROR operations

texts: Is phase-shifting in continuous-time analogous to the rotate-left (ROL) and rotate-right (ROR) operations in discrete-time?


texts: Deconvolution - Richardson Lucy vs. Wiener Filter

texts:
I am studying some deconvolution techniques, In order to remove motion blur, like:

Richardson-Lucy
Wiener

Are there any pros / cons of using one versus another?
For example which are the pros / cons of Richardson-Lucy technique?


texts: Difference between Gabor filtering and Discrete Wavelet Transform

texts: Both Gabor filtering and discrete wavelet transform (DWT) analyze the image in both spatial and frequency domains, unlike Fourier transform which analyzes the image only in the frequency domain. What is the difference between DWT and Gabor filtering?


texts: Relating bin numbers to frequency non uniform fft

texts: I understand how to relate bin numbers of FFT output to frequency when dealing with a uniform FFT. How does this process work with a non-uniform FFT?


texts: How to compute Laplace Transform in Python?

texts:
I am trying to do practicals for signal processing where I need to Laplace Transform a function. Used 'fft' of numpy before. Nothing of Laplace is found in the documentation. Do we have any other alternative?

Please go through the notebook to understand the problem (would love to get suggestions/contributions]

https://github.com/sachinmotwani20/Raw-Signal-Processing-Python/blob/master/LaplaceToFourier.ipynb


texts: what is the type of filter that has values ones?

texts:
I used the filter with values ones but i don't know what kind of type is?

p=ones(1,L) where L is the length of the filter

in this case what we can name the filter?


texts: How to derive an expression for the optimal importance distribution?

texts:
I'm trying to answer the exercise 7.6 letter b of this book:

https://users.aalto.fi/~ssarkka/pub/cup_book_online_20131111.pdf

page 133 but I'm having some problems in understanding the question because there is no explanation in the book about how to derive the optimal importance distribution... just references to that ( page 125 ) but the problem is that the references are books that I don't have access to them. If someone can put me on the right direction, it will be very helpful. This is the question:

Update 1: Base on Atul Ingle answer, I believe the answer is something like this:

These images are taken from:

https://www.amazon.com/Beyond-Kalman-Filter-Applications-Hardcover/dp/158053631X


texts: Power Line interference with different Sampling frequency

texts:
I've been playing around with EEG data from an online database.

If the power line interference (PLI) is at 50Hz and sampling frequency is 64Hz, then according to the Nyquist theorem, the 50Hz PLI should be aliased with 14Hz.

But according to the database header file, the signal from EEG channel is processed by some prefilter, which is a bandpass filter with passband 0.5Hz - 32Hz.

So in the end, the raw EEG data I get from the database, is analog signal sampled at 64Hz and bandpass filtered in 0.5Hz - 32Hz range.

So my question is, do I have to design a notch filter to remove the PLI at 50Hz if the signal has already been bandpass filtered (32 Hz above removed.)


texts: I would like to know what are the advantages/disadvantage of zero padding with respect to frequency measurement and amplitude measurement


texts:
I'm looking for your opinions.

I have obtained a Speech Signal and computed a STFT on this signal. I have split the signal into blocks of (100 x 256) and computed the STFT based on different Windowing functions. But, they all bring back similar results (outputted on the same block) I know this might make sense, but, I assumed that because I was using different Windowing functions, it would have a major impact on the results..

Barlett:

Hamming ^^
Note how the block contains no actual speech, just white noise as it's the first block. Does this look normal, or, is there something wrong here?


texts: Estimating velocity from known position and acceleration

texts:
I am stuck at modeling a system model, i.e. getting my state vector and input vector. My guess is that position and velocity are state vector and acceleration is input vector. My 2nd guess is that all three quantities are in state vector and none in input vector.

So... what is state vector and what is input vector in my case?

--

Additional info:

I get measurements from position sensor and acceleration sensor. Everything is happening in 1D, for example on a straight line. I want to merge these readings (and remove the noise) to get an estimation of velocity for each timestep.

These equations describe the system; I am not sure if they're modeled right though. If I understand correctly it's safe to predict that acceleration is constant (even though in reality it changes) - because process covariance matrix fixes this assumption (right?).

I have also some sample data to work with (input values aren't noised here for simplicity):

 time    pos     acc      what I should get as output (velocity)
[0.0s]  0.000, -0.000  | 18.850
[0.1s]  1.885, -0.113  | 18.850
[0.2s]  3.768, -0.227  | 18.839
[0.3s]  5.650, -0.340  | 18.816
[0.4s]  7.528, -0.452  | 18.782
[0.5s]  9.401, -0.565  | 18.737

ADDITION 2:

For better communication I'm creating a new answer but should be treated as a comment to the first answer. Jason you've already helped me tremendously and I really am grateful for your time. I still have problems with this though - the results from Kalman Filter are not as expected. May you find the time please review the following, thanks. I already owe you a beer or two (or coffies if you like) - if you have paypal contact me on primoz[a t]codehunter.eu :)

I've implemented the model Jason had proposed in first answer. I added the jerk as 4th state variable. After hours of reviewing I decided to come back here for help. The values I get out of KF aren't as expected. Table below represents the data from first 10 iterations of algorithm. Notice how jerk is increasing each time step thus making other estimates wrong. After one second the difference between real acceleration and estimated is more than 1m/s² (see table, last row)!

           real           measured                   estimated                    real
time   pos     acc       pos    acc        pos      acc    jerk    vel[!]       velocity
0.0   0.000  -0.000    -0.040  0.030  |  -0.300   -0.060   0.000   18.850  <-->  18.850
0.1   1.885  -0.113     1.965 -0.153  |   1.585   -0.061  -0.006   18.844  <-->  18.844
0.2   3.768  -0.227     3.778 -0.247  |   3.469   -0.066  -0.035   18.835  <-->  18.827
0.3   5.650  -0.340     5.750 -0.370  |   5.351   -0.090  -0.122   18.815  <-->  18.799
0.4   7.528  -0.452     7.358 -0.452  |   7.228   -0.152  -0.291   18.769  <-->  18.759
0.5   9.401  -0.565     9.251 -0.555  |   9.094   -0.282  -0.574   18.673  <-->  18.708
0.6   11.269 -0.677    11.309 -0.717  |   10.938  -0.518  -1.006   18.494  <-->  18.646
0.7   13.130 -0.788    13.260 -0.758  |   12.752  -0.840  -1.490   18.233  <-->  18.573
0.8   14.983 -0.899    15.043 -0.949  |   14.520  -1.286  -2.096   17.854  <-->  18.488
0.9   16.827 -1.009    16.977 -1.089  |   16.235  -1.838  -2.770   17.362  <-->  18.393
1.0   18.661 -1.118    18.831 -1.168  |   17.890  -2.477  -3.476   16.762  <-->  18.287

My matrices are here:

What is causing this addition in each timestep for jerk? Is any of my matrices wrong?

The same goes with the first solution (only 3 state model) - the acceleration isn't changing as it should.

LAST EDIT:

I've finally managed to make it work. I am not sure if there was an implementation error or wrong P&Q matrices.


texts: Equal loudness curves: any good numerical approximation equations?

texts: What might be, if any, some good numerical approximation functions to the ISO 226 family of human perceptual equal loudness curves?  Is there a polynomial fit of reasonably low degree?


texts: What is use of a gaussian filter over histogram?

texts:
I am working in the field of digital image processing and currently i am reading this paper and I have two questions about it....

After applying a gaussian filter to a histogram, will the pixel values of the new histogram be changed or not?
And will the sum of pixels in new histogram be the same or not?


texts: Discrete (Inverse) Haar (2D) transform implementations

texts:
I am interested in implementations of the Haar transform, and its inverse, such that when composed always result in the identity operation.  My inputs are discrete ordinals within a given range - and I need the output of the Haar transform to be similarly discrete ordinal (or fixed-point) numbers.

I've worked on the basis that if my input signal consists uniformly distributed samples on the range $0..(2^n-1)$ and, so does my transformed signal, then in principle, my original signal should be reproduced perfectly by the inverse haar.

I've dabbled with this (Matlab) implementation using GNU Octave:

http://people.sc.fsu.edu/~jburkardt/m_src/haar/haar.html

Which uses double precision values... forcing me to use round() to establish a discrete representation of the transformed data so as to fit the transformed representation into the same state-space as the original.  Unsurprisingly, I found I needed to use round() again to the output from the inverse transform.

It will probably come as no surprise that round(haar_2d_inverse(round(haar_2d(signal)))) is not quite the identity function for most values of signal... Anecdotally, there are typically a few out-by-one errors in the reconstructed signal - which seem roughly symmetric (+1 or -1 on a small number of the reconstructed samples) and this seems almost independent on the choice of n.

What I'd like to know is if there are 'better' implementations of haar_2d and haar_2d_inverse that work on ordinal samples?  Are the anomalies the consequence of the Haar implementation itself or the way I've applied round() at the intermediate stage?  If the latter, can I rectify this by scaling before rounding?


texts: Deconvolving a 1d Signal Using a Lookup Table of Kernels

texts:
assuming I measure a signal that has different PSFs per position in time.
for example:
t = linspace(0,20);

% "ground truth" signal will be like:

x = @(t0) exp(-(t-t0).^2/0.1)  ;

% some made up impulse response (psf) that depends on t0 will be:

h = @(t0) diff(diff(  exp(-(fftshift(t)).^2./(0.1*t0) )));

% the convovled signal:
y = @(t0) conv(x(t0),h(t0) ,'same');

% now if I have signal from two positions, I get:
plot(t,y(3)+y(15))

Note that the two peaks now are distorted differently as function of their position.
What methods can I use here,  given that I have such a PSF lookup table, such as that h = @(t0)... above, to deconvolve my 1D signal, even though it will behave differently in different positions as seen in the plot? just a standard deconvolution wont work here.
EDIT : trying to clarify the question further. I am looking after a way to "deconvolve" the signal that is distorted by such position dependent PSF. So instead of these two features I will be able to trace back the original signal (this case just two peaks).  Using standard de-convolution schemes will not work well because they assume an effective single PSF, and here we have a "family" of PSFs. Is there a way to solve it?
I was hoping, for example, that extending the dimension of the PSF will allow to accommodate such effect, or maybe using other tools to "train" a system to understand it.
EDIT 2:
Here's a file that show an example of x - the ground truth signal, y - the signal convoluted by the positions dependent psfs (or kernels) and, psfs -  an array of kernels per position.


texts: FFT on non-periodic signal and signal power at each harmonic - is there a more robust approach?

texts:
I have a non-periodic signal collected from a force plate, it represents the foot/ground contact of a human when running.

My aim is to calculate the signal power of each harmonic up to 50Hz. I will break down what I have done so far.

Firstly, I calculate the fundamental frequency by dividing the sampling frequency by the length of the signal. I then find the other harmonics by multiplying the fundamental frequency by 2,3...etc (not shown here, this example just includes the fundamental frequency (FF).

Fs = 1000;
FF = Fs/(length(Fz_data));

I run the FFT on my signal.

dt = 1/Fs;
t=(0:1/Fs:(length(Fz_data)-1)/Fs)';
NFFT = length(Fz_data);
Y = fft(Fz_data,NFFT);

For each harmonic (identified in 1 - FF in this instance),I zero out frequencies above and below the harmonic and then run ifft to convert the data back to the time domain which leaves me with the data for the first harmonic only(?).

F = ((0:1/NFFT:1-1/NFFT)*Fs).';
Y(F<FF-0.1) = 0;
Y(F>FF+0.1) = 0;
y = ifft(Y,NFFT,'symmetric');

I then calculate the power of this signal using pwelch.

[P,~] = pwelch(y,ones(NFFT,1),0,NFFT,Fs,'power');
pwr = sum(P)

Questions

From a programming perspective, this works, but I have reservations that this approach is not based on sound theory. I will, therefore, present some questions below, and I hope the community may be able to offer some solutions to improve the robustness of this approach.

Is it suitable to calculate the fundamental frequency from the length of the signal?
I have read that it is not suitable to use an FFT on a non-periodic signal. Is there a way to adapt the FFT method to make it more suitable e.g. some sort of windowing function?
Is there an easy way to remove drift/bias from the signal?
I would also welcome comments on any other aspects of this process if you feel it would make it more robust.

Thanks in advance.


texts:
What are the advantages orthogonal filterbanks such as the DFT or DCT have over non-orthogonal filterbanks?

I have heard quite often that they have attributes that are desirable when modifying the intermediate signal, i.e. when performing quantization during audio coding.


texts: Is it worth recording 4K resolution from a 1080p camera input?

texts:
I work with this as a recording setup: Canon 5D3 into an ATEM MINI recorder into Ecamm Live (primarily for the sake of bypassing the 30 minute limit at present, not for live-streaming), but eventually uploaded to YouTube.
I've been recording to the 1080p setting, but I'm concerned that my files are too compressed to start with, giving fairly poor quality on YouTube after export.

Ecamm Live has an option to record to a 2160p 4K resolution, which of course gives larger files sizes with higher bitrates.
Is this going to improve the quality of the image being recorded, where the clean HDMI input from the 5D isn't changing, i.e. is the higher bitrate going to produce a more uncompressed image than just recording to 1080? Or is it simply making a pixel of the same quality take up the space of 4?
Perhaps would uploading the final version in 4K to YouTube help improve the image?
Or is YouTube's compression such that there's not much I can do?


texts: What's the fastest way to get the phase angle and amplitude of a COSINUS 50hz signal?

texts:
I'm not a DSP specialist.I'm working in transmission and distribution.
I need to retrieve the amplitude and phase angle of a discrete 50Hz COSINUS signal as fast as possible. Right now I'm using a Sliding DFT an I can manage to get this information in 10ms (half period) but I would like to know if it's possible to have it faster. I can adjust the sample time up to 1micro second.

I need to have this information (amplitude and phase angle) as fast as possible because it will determine the time constant of my corrector.

Thank you in advance for your precious answer


texts: Bias instability in Gyroscopes : AVER / ADEV

texts:
I am attempting to implement allan variance to determine the amount of bias that is shown in my IMU's gyroscope ( BMI160 ). I am doing this with the following formula, that was captured in the following tutorials: Tutorial 1 and Tutorial 2

Formula for AVAR:

$\sigma_y^2(\tau) = \frac{1}{2(N-1)} \sum_{i=0}^{N-1}(y(\tau)_{i+1} - y(\tau)_i)^2$

From my reading, I am implementing the calculation using the following statements:

$\tau$ - Bin of time ( 5 seconds of data, 10 seconds, 15 sec, etc ) So if my $\tau$ is $5$ sec, then I'd multiply $5$ by my sample rate to get the number of sample points that I can stuff into a bin. ( $5*40=200$, given that my sample rate is $40$ )

$N$ - Total number of bins that I've split my data into. ( Number of sample points per bin divided by total number of data points, without the remainder )

$y(\tau)$ - The average ( mean ) of the data in some bin of time

I then plot the ADEV ( Sqrt of AVAR ), over $\tau$, and see the following result:

What I see in that plot is that different axis have different bias instability levels. I did not collect hours of data to let the graph start rising again, like a true allan variance plot would. But for the purpose of this question, let's assume that the graph starts rising for each axis after the point i've selected on the graph. ( in the image )

Questions:

When a manufacturer releases a datasheet, and they say that the gyro bias instability is "$0.55^{\circ} / hr$ ", are the taking the average of all three axis to come up with one value? Looking at my plot, that would be rather poor, as two of the axis are fairly low as compared to the third.
Does it make sense to say that you'd want to see a low bias instability, and for it to be identified through a very small $\tau$? i.e Manufacturers claim $0.55^{\circ} / hr$ but rarely in a datasheet do i see the result of $\tau$ being shown of where that value was found. A sensor with $0.55^{\circ} / hr$ at a $\tau$ of $5$ should have significantly less bias than the one with the $\tau$ of $25$. No?


texts:
I have an open-loop system function

$$L(s)=6\frac{(s-2)^2}{s(s-20)^2}$$

and I wanted to to the root locus diagram for it. I did it in MATLAB and got the following graph

What I don't know how to do by hand is dealing with the double poles (and zeros). I mean, I think that that's the cause why there are two lines going out from that pole at $s=20$ and two going to $s=2$.

Is there a way of, more or less precisely, draw those lines by hand?
How can one get the specific value of $k$ for any position of the root locus without using MATLAB (namely, doing it with a pen and a paper)?


texts:
Can we sample the Dirac function?

$$ x(t) = \delta(t) $$

Can we sample a DC signal?

$$ x(t) = 1$$
I think that we can't sample $x(t) = 1$ because the Fourier Transform of $x(t) = 1$ is $2\pi \delta(\omega)$ (the Dirac function)
and we can't sample the Dirac function because it extends to $\infty$ and we cant find $f_\mathrm{max}$.
I find this solution but I am not sure. Can anyone help?


texts: Let's say we have a signal $x[n]$ upsampled at the transmitter by $4$ and then downsampled at the receiver by $4$ too.   As known, the performance will be much better compared with transmitting the signal without upsampling.  but what I need to understand, what is the disadvantage of using up-sampling ? Does that effect the data rate of the transmitted signal since we transmit $4$ times the signal $x[n]$ instead of $x[n]$?


texts: What is the best Algorithm to estimate the frequency for Almost-Periodic Data or complex periodic data?

texts:
I’ve got what it looks like a periodic signal but the periods seem not equally repeated, I want to estimate the PSD, particularly I need to obtain the dominant frequency of this data. I’ve estimated the autocorrelation and then applied FFT, the results as shown in the figures below.
It seems that FFT algorithm is not the best option for this kind of data. Could anyone please suggest another solution?.

Time series

autocorrelation

PSD


texts: Transfer function: from poles and zeros to polynomial coefficients

texts:
I understand how this transfer function was solved except I don't know how to get the 0.87.
Any help would be appreciated.


texts: Optimal receiver for a binary system employing waveform $s=A\cos^{2}(\pi f_c t \pm \alpha)$

texts:
I want to design an optimal (minimizing error probability) receiver for system of two waveforms (with $0<\alpha<\frac{\pi}{2}$):
\begin{align}
s_1 &=A\cos^{2}(\pi f_c t + \alpha)\\
s_2 &=A\cos^{2}(\pi f_c t - \alpha)
\end{align}
It seems like a modified BPSK, as:
\begin{align}
s_1&=A\cdot\ \frac{1 + \cos(2\pi f_c t + 2\alpha)}{2}\\
s_2&=A\cdot\ \frac{1 + \cos(2\pi f_c t - 2\alpha)}{2}
\end{align}
But I don't know what to do next.


texts:
Related to another problem I'm having, I was looking into the workings of numpy's rfft2 and irfft2. These are special versions of the FFT routine, in so far that it needs less input; because you require the real-space image to be real you only need to 'fill' half of Fourier space - due to symmetry, that's all the information you need.

Now, in the docs it is mentioned that performing the inverse transform right after the forward transform should return the original array - to within numerical precision. Time to put this to the test.

If I do the following:

import numpy as np

fourier_image = np.random.uniform(-1,1,(100,51))
fourier_recovered = np.fft.rfft2(np.fft.irfft2(fourier_image))

print 'Original power: ', sum(sum(abs(fourier_image)**2.))
print 'Recovered power: ', sum(sum(abs(fourier_recovered)**2.))

... I find the original power and the recovered power differ at the percent level. That seems a rather big difference to me. Am I doing something wrong, or is this just the best we can do?


texts: Simple crosstalk cancellation (or signal separation)?

texts:
To start with, I'm pretty new to DSP, so forgive me failing to understand any basic concepts.

I'm working with an iOS app that depends on the input from the analog audio jack whilst monitoring the signal through output (headphones, etc). Unfortunately, iOS devices suffer from crosstalk given a high enough volume due to the proximity of the output and input leads.

Garageband on iOS provides something called "Crosstalk prevention" for monitoring guitar audio playback through its amp modelling. I've no idea how they do it but it's something I'd like to do in my app.

I've access to the output signal, and I perform a FFT on the input signal (to perform spectral noise gating) anyways, so anything that uses fourier transforms might be good since I'm doing that operation. It's difficult for me to find any solutions as DSP is pretty new to me.


texts: I've found almost nothing about difference equations on the internet. Can you please recommend me something like books or pdf online that handle deep this topic? I'm searching also some exercises. Thank you!


texts: Are there any signals with brickwall autocorrelation?

texts:
Are there any signals whose autocorrelation $R(\tau)$ has the following form? Assuming $\tau_c > 0$ and $R_0 > 0$ a constant,

$$R(\tau) = \begin{cases}R_0, \text{ for $|\tau| < \tau_c$} \\ 0, \text{ otherwise}\end{cases}$$


texts: discrete Cepstrum: can you help me understand it?

texts: Since months I am working on a spectral envelope estimation algorithm. I even devised an innovative one (90% done) but I first wanted to have a complete panorama of the present art. I pretty understood most of the published methods and their limitations, including cepstral smoothing, lpc and true envelope. Unfortunately I cannot understand the Discrete Cepstrum method even minimally. I am an experienced dsp coder but not a math guru, I tried to study all web pages and publications explaining it but they are using too many complex formulas and obscure math concepts and my mind gets lost. But since I am not stupid, if someone would explain it to me in layman terms I would surely understand its principle. Can somebody help or offer a link where the Discrete Cepstrum is explained with understandable words ?


texts: Finding the maximum and minimum frequency of a 2D image

texts: Suppose I transform the image into frequency domain and obtain a 2D array of complex numbers. How can I determine the minimum and maximum frequency from that array? By finding magnitude of each complex number and then applying a search algorithm?


texts: Transfer function model to frequency response

texts:
I have a problem, I wanted to filter the signal with a Butterworth filter built on the basis of a prototype. I have zeros and poles and an $H (s)$ answer, and I do not have the frequency response. How do I get it?
I got transfer function using zp2tf and tf.
% z -> zeros
% p_lp -> poles of designed low pass filter
% k -> amplification
[num, den] = zp2tf(z, p_lp, k)
sys_lp = tf(num, den)

result is:
Transfer function 'sys_lp' from input 'u1' to output ...

                 1.6e+10
 y1:  -----------------------------
      s^2 + 1.867e+05 s + 1.742e+10

Continuous-time model.

and the body of filter is shown using
bode(sys_lp);

I tried to filter signal "modulated" by using function filter() but it is not that way. The result is not what it should be.
y_lp = filter(num, den, modulated);

Now I am thinking of get reference of bode values to array and multiply by the spectrum of both signal to get a filtered signal.
And this is my question, how do I get a frequency response if I have poles, zeros or transfer function using Matlab or octave to used them later to filter the given signal? Thank you.
Full code:
function [osX, P1] = computeFFT(data, freq)
    L = length(data);
    % fft
    transform = fft(data);
    osX = 4;
    P1 = 5;
    % two-sided spectrum
    P2 = abs(transform/L);
    osX = freq*(0:(length(P2)/2))/length(P2);
##    % single-sided spectrum
    P1 = P2(1:L/2+1);
    P1(2:end-1) = 2*P1(2:end-1);
endfunction

N = 16;
M = 6;

m = 1;
% CARRIAGE
fc = (100 + 2 * N) * 1000;
% MODULATE SYGNALS
fm1 = 1 * N * 1000;
fm2 = 1.5 * N * 1000;
fm3 = 3.3 * N * 1000;
% sampling frequency
fs = 100 * fc;
t_common = 0: 1/fs: 2000*(1/fs);
% Amplitude = 1
C = 1;
M = 1;
dcoffset = 0;
OMEGA_C = 2 * pi * fc;

% CARRIAGE
c = sin(OMEGA_C * t_common);
% MODULATED SYGNALS
m1 = sin(2 * pi * fm1 * t_common);
m2 = sin(2 * pi * fm2 * t_common);
m3 = sin(2 * pi * fm3 * t_common);
m = (m1 + m2 + m3) / 3;

[osX_C, P1_C] =  computeFFT(c, fs);
[osX_M, P1_M] =  computeFFT(m, fs);

% MODULATED SIGNAL
modulated = (C + m) .* c;
[osX_AM, P1_AM] =  computeFFT(modulated, fs);

Apass = 0.6;  % dB
Astop = 16;   % dB

Gpass = -0.6;
omega_pass = 1; % lucky shoot?
Gstop = -16;
omega_stop = 5; % lucky shoot?

OMEGA = omega_stop/omega_pass;

top = log10( (10^(-Gstop/10) - 1)  / ( (10^(-Gpass/ 10) -1 ) ));
bottom = 2 * ( log10(OMEGA));
m = top / bottom ;
n = ceil(m)

% poles
p = zeros([1 n]);
for k = 1:n
    p(k) = exp( ((i*pi)/(2*n)) * (2 * k + n - 1));
end;

p_lp = zeros([1 n]);
for k = 1:n
    p_lp(k) = p(k) * (fs-2000);
end;

pkg load signal;
z = []; % zeros
k = 1.75*10^14; % amplification
% z -> zeros
% p_lp -> poles of designed low pass filter
% k -> amplification
[num, den] = zp2tf(z, p_lp, k)
sys_lp = tf(num, den)
figure(10)
sys_disc = c2d(sys_lp, 1/fs);
bode(sys_disc);
[numd, dend] = bilinear(num, den, fs);
y_lp = filter(numd, dend, modulated);
[osX_lp, P1_lp] = computeFFT(y_lp, fs);

figure(11)
subplot(3,2,4)
stem(osX_lp(1:30)/1000, P1_lp(1:30), "r");
set(gca, 'FontSize', fontSize)
title('FFT CLOSE ONE', "fontsize", 24)
xlabel('f (kHz)', "fontsize", 24)
ylabel('|P1(f)|', "fontsize", 24)
```


texts: Why pixels on image edges are shifted when using Wiener filter?

texts:
I implemented a Wiener filter using Matlab and i noticed that both functions(mine and matlabs) are creating an image with shifted pixels on the edges. Class teacher said it will happen. Is there a simple explanation to that?

Code:

%open image
I = imread('pout.tif');

%sigma for gaussian
sigma = 1.2;
%gaussian kernel max width/height
N = 2*ceil(3*sigma)+1;

%gaussian PSF(point spread function)
PSF = fspecial('gaussian',N,sigma);

%Noise
NSR = 0.05;

%Matlab's Wiener function.
I1 = deconvwnr(I,PSF,NSR);

%New PSF for my implementation
PSF1 = zeros(N,N);
%loop to create the 2D gaussian psf.
x = (N/2)-0.5;
for i = -x:x
    for j = -x:x
        %gaussian
         PSF1(i+x+1,j+x+1) = exp( -( ( (i^2) + (j^2) ) / ( 2 * (sigma^2) ) ) );
    end
end

%normalization
PSF1=PSF1/sum(sum(PSF1));

%fourier transformation of PSF1.
fouri = zeros(size(I,1),size(I,2));
fouri(1:N,1:N)= PSF1;
H = fft2(fouri);

%uint8 to double of the original image.
I = double(I);
%fourier transformation of the image
Y = fft2(I);
%Wiener function.
X = conj(H)./ ( abs(H).^2 + NSR ).*  Y;

%exit from fourier transformation.
I2 = real(ifft2(X));
%go back to uint8 for both images.
I2 = uint8(I2);
I = uint8(I);

%Results.
subplot(1,3,1); imshow(I); title('Original');
subplot(1,3,2); imshow(I1); title('Matlab function');
subplot(1,3,3); imshow(I2); title('My implementation');


texts: Is there in signal processing similar method than Otsu's method in image processing?

texts: I'm just wondering that is there any similar method for separate signal and signal+noise in signal processing like otsu's method set threshold to valley of image histogram? And if there is how can I implement it in Matlab.


texts: Simulate packet loss in internet video streaming

texts: i have encoded H.264 video using ffmpeg . I want to apply packet loss model like Gilbert Eliot model to depict  video transmission over unreliable network. Like in this thread TV noise is simulated. But noise in internet is different. So is there a way to simulate packet loss/ noise for video streaming using ffmpeg or matlab?


texts: How to resize a Summed Area Table/Integral Image?

texts:
There is very clear explanation on how a Summed Area Table/Integral Image works here:
https://uk.mathworks.com/help/vision/ref/integralimage.html

How to you scale this SAT/Integral Image?

For example, I wish to downscale it from 16x16 to 8x8. How would I go about calculating that?


texts:
Constant False Alarm Rate (CFAR) is an automatic thresholding technique. It's situated after the FFT processing in other to detect target peak. This probability of detection depends on clutter and noise level. In automotive RADAR, there are many other issues, like multi-path and interference. My questions are:

Is CFAR or XX-CFAR stay efficient detectors in presence of multipath and interference? If No, could you suggest me other techniques/methods to efficiently detect true targets in presence of interference and noise?


texts: Extracting Binary Magnetic-Strip Card Data from raw WAV

texts:
I am faced with a tricky challenge:  To extract binary data from an iPhone magnetic strip card reader. This is what the magnetisation on the card looks like:

Source

Here is the .WAV the iPhone receives when you swipe a card (don't get your hopes up too much, it is a bonus loyalty card ;)). That's three swipes by the way, at different speeds. This is the raw SInt16 dump for the swipe I am using.

Someone seems to have done it here  but the actual data I capture isn't particularly easy to process.

The reading starts (and finishes) with an indeterminate number of 'zeros ' --  note that the wave only repeats after 2 ZEROS have been collected, this represents N-S followed by S-N:

(note that each of the three lines represents me swiping a different card; the bottom card in this image is 15 years old, so the magnetic field is clearly severely degraded in some places, not visible in this shot)

This will allow an algorithm to ascertain a clock tick.

The magnetic field reverses on each clock tick.  Also for a binary 1, the magnetic field reverses exactly in the middle of a tick:

The sequence always starts with a 1101+0(parity bit) start sentinel.   You can pick this out in all three readings in the above graph.   It is indicated more clearly in the cosmodro article I linked at the top of the question.

Here is an example of magnetic degradation (taken further along on the bottom card reading):

I am trying to figure out a sensible way to convert this waveform into its corresponding binary sequence.

I have found one PDF that goes into some detail,  but I can't figure out the algorithm they are using.

This PDF contains one interesting image:

If I could extract the red and blue lines as per this diagram,  I could use either one of them to extract the data, but I can't figure out the logic behind the construction.

So this is my question: How do I extract the binary sequence?

PS.  Note that the swipe speed is not going to be constant. So once the clock has been determined, in needs to be constantly adjusted from one tick to the next.

PPS.  Would autocorrelation catch pairs of ticks?  (seeing as ticks will alternate N-S S-N ... )

EDIT (June '12): I needed a lot of help on this one, but finally I have completed a solid reader ( http://www.magstripedecoder.com/ ).  Thanks for everyone who helped!  I recommend #musicdsp on IRC's efnet channel for anyone dedicated enough to take the challenge of getting to grips with the maths -- it's really really hard!


texts:
With the advent of 5G Era, base station density
increases, the cell radius decreases, and LOS propagation
gets more dominant. So, why do we need for beamforming in 5G NR, although we have smaller cells and we have a small number of devices in a cell?


texts: How exactly is analog Signal to Noise Ration (SNR) defined?

texts:
Say, my ADC reads noise signal only, not sure how to define a threshold. Let's say my noise is sitting at 0V (zero mean), oscillating between +5 mV to -5 mV, so Vnoise = 10 mVpp. I'm looking for 20 dB SNR with target present. Does it occur when ADC reads either 10^(20/20)(5 mV) = 50 mV or 10^(20/20)(-5 mV) = -50 mV OR when it's 10^(20/20)(10 mV) = 100 mV or 10^(20/20)(-10 mV) = -100 mV?

Now, a different scenario, what if my noise oscillates between -5 mV to +5 mV but there's a noise spike at +7 mV and -6 mV (just 2 values out of 10000 samples collected), do I change my threshold based on maximum noise level, not mean noise level?


texts: Median Filter for salt and pepper noise removal

texts: Why median filter is considered as good for removal of salt and pepper noise? What are the other filters used for the same?


texts: How to remove varying noise from strain data in MATLAB

texts:
I'm very new to signal processing. I have some data measured over time at 800 Hz. I'm interested in the high frequency signals. You can easily identify them in the image below (in this case, 3 signals):

You can easily see that there is a visible trend in the noise. This trend is mostly different for every such data that I have. I know that this is due to the environmental effects (temperature) but unfortunately, I don't have a temperature sensor set up.

I'm looking for a scientific way to extract these signals from the noisy data. Currently, I visually find the beginning and the end of each signal, consider the beginning of the signal to be zero and then offset the entire signal by that value.

Is there a way through which I can process the entire data and remove the noise from it entirely in one go? Are there any built in functions in MATLAB for the same?


texts: Replacing "e" in Euler's formula with another number

texts:
Does Euler's formula remain valid if we use any real number other than the constant $e$?   For example replacing $e$ with 5 would make the formula look like this:  $5^{it}$.

I tried this idea in Matlab and replaced $e$ with few other real numbers (eg 1.5, 10, 2.1) and each time the plot was still showing what seemed like cosine and sine waves. The frequency of the cos and sin was changing depending on the base.

Here's roughly my approach:

w = freq * 2 * pi;
t = 0:0.001:1000 ;

a = real( number ^ (i*wt) ) ; % cos in Euler's formula
b = imag( number ^ (i*wt) ) ; % sin in Euler's formula


texts:
I have an PCM (pulse-code modulation) signal. If I want to work out the frequency of a sample $ x $ long, I count the number of peaks/troughs of the sample, and divide by $ x $. The equivent dB of frequencies $ 20Hz > 20 000 Hz $ is then just the equivelent dB of the signal as a whole

However, I would like to create a spectrum analyzer of the type shown below. This requires extracting the equivelent decibels of different frequencies in the signal. So I need to split the signal into different signals of different frequencies, so I have signals of $ 20Hz > 5000Hz $, $ 5000Hz > 10000Hz $,  $ 10000Hz > 20000 Hz $, ect.

How can I extract signals for the different frequencies from one master signal?


texts:
In Practical Signal Processing (Marc Owen), an exercise explore the topic of undersampling:

  [...] Suppose you know that an audio signal is a sine wave with a frequency that might be in one of two ranges, either between 120Hz and 130Hz or between 150Hz and 170Hz. What is the lowest sample rate you could use, and still be able to reconstruct the signal from (real-valued) samples? What if the second band extends from 150Hz to 172Hz?

The answers are actually provided at the end of the book (60Hz and 86.666Hz) but without further details.

I have apply some of the theory on undersampling and found the different ranges possible for each frequencies. For example, with $n=3$, I can see that the aliases possible for the range 120Hz-130Hz is $86.666 < fs < 120.0$. This theory applies well for one band but I can't find any explanation on the dependency created by another band. I cannot just take the intersection of both sets as it does not cover the case where the ranges are overlapping.

I also did a GNURadio example to see the influence of the sample rate on each range. By moving the sample rate slider around, I can see that 86.66Hz is indeed the solution (for the second case) but is there an analytical method to find this result?

Thanks


texts: How do I perform a time domain phase shift in the frequency domain?

texts:
I've seen some information on this topic around, but I don't quite understand it.

I have a time domain signal. I understand that if I want to time shift this signal, I can do so by multiplying its Fourier transform by $\exp(-j\omega\delta t)$, where $\delta t$ is the time delay.

However, what if I want to introduce a phase shift in the time domain signal? What would I multiply its Fourier transform by? Or do I have to do this transformation in the time domain?

For context, I am trying to apply both a time delay and phase difference to a time series to correlate with another one, given that the detectors that produced the data are a distance apart and have different orientation towards the source of the signal.


texts: doing sine regression to recover the paramters from a given signal

texts:
I have a discrete signal. I want to do sinusoidal regression to estimate the parameters such as amplitude, phase, frequency, etc.

It is important to note I only have the signal values and have no time when these values were recorded.

How could I possibly do the sine regression?

Thanks.


texts:
In order to detect a frequency component of 1 Hz with a DFT - do I need a signal window (signal in time domain) of at least 1 second length (in order to have at least 1 cycle of the desired minimal frequency I want to detect)?
Or is it possible to evaluate the spectrum of low frequencies with short signal windows (in seconds - independent of sampling frequency)?


texts: Nonuniform sampling band-limited gaussian white noise

texts:
I'd like to sample band-limited Gaussian white noise non-uniformly. One way to approximate this would be to filter Gaussian white noise with a lower cutoff frequency and non-uniformly pick samples from this. However this approach would limit me to a fixed number of time-offsets and require many samples of noise to achieve sufficient resolution.

Is there any better way to do it?


texts:
I have a question about calculating the power and Energy of an audio recording.

I have imported a waveform of an audio recording in WAV format into Matlab and then calculated the energy and power in the time and frequency domain. Using Parseval's theorem, the energy in time and frequency is the same.

 clear all; close all;

 %Wav File einlesen und die Daten in data und Abtastrate in Fs
 [data,Fs]=audioread('120A_v20_05s.wav');  %Ermittlung der Arraygröße
 [nSamples,nChannels]=size(data); %Länge der Audiodatei ermitteln
 waveFileLength=nSamples/Fs;

 t=[0:length(data)-1] / Fs;

 %Signal darstellen figure
 plot(t,data)
 ylim([-0.3 0.3])
 title('120A v20')
 grid on xlabel('Zeit')
 label('X(t)')

 E1_timedomain=sum(abs(data.^2)); % Energy time domain

 L=length(data);
 Ptime=(norm(data)^2)/L;  % Power time domain

 y = fft(data);

 Pfrequ=sum(y.*conj(y))/(L^2); %Compute power with proper scaling.
 E1_frequdomain=sum(abs(y.^2))/nSamples; % Energy frequency domain

E1_timedomain = 4.003
Ptime = 1.8154e-04

My question is which units have the energy and power in this case? Joule and Watts or do I have to consider a factor?

Many Thanks!
Greetings Mathias


texts:
This is quite an "applied" question, but I don't see any more appropriate StackExchange, so here it goes. My situation is the following:

I have a sizeable (> 40) set of images (photos) that have been scanned using a flatbed scanner.
Unfortunately, there was a "smudge" due to some item previously placed on the scanner. This smudge remained fixed for all the scans, since it was due to some small amount of translucent residue on the glass bed.
The photos may be rotated some multiple of 90 degrees and offset, but are otherwise exactly what was scanned (high-resolution TIFF images).

Would it be possible to extract the "smudge" (i.e., the equivalent of an image filter applied to the physical photo that results in the scanned image), and then apply the inverse of this filter to all my images (with appropriate rotation and offset)? I don't know if tools already exist that could do this, but any guidance as to algorithms/approaches would be much appreciated.


texts: How is a Particle Filter used to Estimate Parameters of a State Transition Function?

texts:
In the tutorials on particle filters that I have seen, it seems that the state transition function is already known. This example from Matlab, for example, states the the Plant or State Transition function is provided ahead of time.
This video, also from Matlab, talks about predicting future state to move particles forward based on the ded reckoning  done by a robot. In that case, the robot knows what it's motion vector is (with process noise) at each step, but it is solving for its position and orientation. So the particle filter isn't involved in predicting this delta that results in future state.
I noticed the same thing in Matlab's description of the Unscented Kalman filter, where the state transition function is given a priori, when the filter is instantiated.
I'm looking for an explanation on how to use the particle filter (and the UKF) to estimate the parameters of the state transition function, but I'm not finding anything about that.
I suppose I can treat the parameters of the state transition function as the space in which I want to generate the particles, and transate those into the same space as the measurements. But for a simpel case of constant velocity in 3 dimensions, that would mean generating particles in 6 dimensions.  Is this how it's done with a particle filter? If not, what am I missing and where can I get a simple explanation of how this would be done?


texts:
I have 3 sensor inputs: $a(t)$, $b(t)$ and $c(t)$. I want to design a filter such that the weighted linear combination of the three is always a constant. Kind of like:

$$w_1(t)a(t) + w_2(t)b(t) + w_3(t)c(t) = k$$

So from my undergrad modules I think I need a adaptive filters. I can perform training to find $k$ and filter weights at initialization.

May I know what is the best filter to implement in my case? $a(t)$, $b(t)$ and $c(t)$ are not independent.

Kelvin


texts: What are some promising areas of research in digital signal processing?

texts: I intend to pursue a PhD program in digital signal processing (DSP). However, it seems nowadays that research has saturated in DSP and it's all about machine learning and deep learning. Are there are any areas in pure DSP that can still be explored for a PhD? If so, what are some research groups that focus on these areas?


texts: How to I obtain the real part of a an Analytic Signal when the real and imaginary parts have been delayed by different amounts

texts:
A real audio signal (0-3 KHz) is processed by a Hilbert filter to obtain the Imaginary component.
Both the real signal and the imaginary are delayed but by different amounts.
I want to obtain the real component of the combined delayed real and imaginary components.


texts: How can I decide proper FFT length(size)?

texts:
I'm trying to understand about deciding FFT length(size) and relative factors.

what If I got the streaming adc data as the below,

1624
20850
10314
-15042
-18908
3717
21175
8479
-16411
-17907
5796
21308
6493
-17713
-16662
7687
21241
4468
-18724
-15291
9750
20929
2392
-19649
-13833
11508
...

Q1. My first question is from here, I want to process with FFT but I don't know how do we decide proper FFT length (size)?

Q2. If I just decide to use FFT8, then can I use FFT8? or if I want to use FFT8 then what should I have to consider what I need to know?
As I know (I'm slowly studying DSP) FFT8's number of inputs are 8. then FFT8 is working as

First term inputs
1624
20850
10314
-15042      =>       FFT out
-18908
3717
21175
8479

Second term inputs
-16411
-17907
5796
21308           =>       FFT out
6493
-17713
-16662
7687

Third term inputs
21241
4468
-18724
-15291          =>       FFT out
9750
20929
2392
-19649

n terms inputs
-13833
11508
...

is this right?

I've read some articles https://electronics.stackexchange.com/questions/12407/what-is-the-relation-between-fft-length-and-frequency-resolution
https://spectraplus.com/DT_help/fft_size.htm But I didn't get it exactly.

So Would you help me to undersatnd how does FFT size decide and calculate process?

Q3, From http://support.ircam.fr/docs/AudioSculpt/3.0/co/FFT%20Size.html, What does 21,53 Hz. mean?
As their description below.

Reminder : Bins
The FFT size defines the number of bins used for dividing the window into equal strips, or bins. Hence, a bin is a spectrum sample, and defines the frequency resolution of the window.

By default :

N (Bins) = FFT Size/2

FR = Fmax/N(Bins)

For a 44100 sampling rate, we have a 22050 Hz band. With a 1024 FFT size, we divide this band into 512 bins.

FR = 22050/1024 ≃ 21,53 Hz.

But I want to know more about 21,53 Hz. exactly FR.


texts: how to plot fft with imaginary and real part in 3d or calculate the degree of rotation

texts:
I would like to make a plot like 1 and see the real and imaginary part in a 3d space. I dont want to make exactly the same plot. for me it is okay if i see the peak for both signals shifted. it is also ok for me if i can only calculate the rotation without plotting.
I tried it with a 3d plot python matplotlib
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3d

//create example Signal, sinus and cosinus-> they are shifted in time so i would like to see the rotation in complex plane

time = np.arange(1000)/1000)
signalSinus= np.sin(100*2.0*np.pi*time)
signalCosinus = np.sin(100*2.0*np.pi*time+np.pi)

fftSinus = np.fft.fft(signalSinus)
ftCosinus = np.fft.fft(signalCosinus)

fig=plt.figure()
ax=fig.gca(projection='3d')
ax.plot(np.fft.rfft(len(fftSinus),d=1/1000),np.imag(fftSinus),np.real(ffSinus)) // three axis plot but how to?
plt.show() //

i dont get right results it looks pretty strange to me :D if i plot both signals they look the same.


texts:
Consider that we have a discrete signal of finite length. How can we find the amplitude and phase corresponding to different harmonics of this signal in Matlab?

Thanks.


texts: which of the analog sinusoidal frequency can not pass through the filter?

texts:
First time I am encountering this type of question so i just tried but not getting whether my logic correct or not.

First let the sinusoidal signal be $X(t)=\cos(2\pi ft)$.

After sampling this signal I will get $X(nT_s)=\cos(2\pi fnT_s)$; now at sampling rate $f_s=18\, \text{kHz}$ it becomes $X(n)=\cos(\frac{n\pi f}{9})$.

Now I am checking optionS $(C)$ (given correct answer is also C) to see if the output of filter will zero or not at $f=12\,\text{kHz}$ and at  12kHz  X(n) becomes
$X(nT_s)=\cos\left(\frac{4\pi n}{3}\right)$  .

$H(z)=1+z^{-1}+z^{-2} $ can be written as
$H(e^{jw})=1+e^{-jw}+e^{-2jw}$, so from eigenvalue concept the value of $H(e^{jw})$ at $w=\frac{4\pi}{3}$ is $H(e^{jw})=1+e^{\frac{-j4\pi }{3}}+e^{\frac{-j8\pi }{3}}=0$, so it's proven that output at 12 kHz will be zero.

Therefore, 12 kHz frequency will not pass.

I am doing by checking options, option B also satisfying this condition.

Is there any alternate method to solve this?


texts: Audio processing. Is it possible to directly access the decoded audio data going into the analog input of a computer

texts:
When a computer transcodes an audio file from one file format to another, does the computer first decode it into the raw digital stream (exactly what is fed into the DAC for the audio output) , or does it do something different without having to completely decode it?

Take Spotify files for example, I believe that they are not in a standard MP3 format that can be played on any device. However, shouldn't it be relatively easy to convert these files into standard MP3 files, by first decoding them and then re-encoding to MP3 format?

Or would it require getting the analogue audio, converting it back to digital and then encoding again. My main query is, do we generally have access to this raw decoded digital audio data?


texts: How to deal with phase incoherence issues after manipulating a signal in the frequency domain?

texts:
Let's say that we want to manipulate a signal in the frequency domain using a short time Fourier transform and once we're done , we use an
inverse STFT (plus overlap and save) to convert the results back to the time domain (this is basically a simple phase vocoder implementation).

Now, the problem is that this process doesn't retain phase information , which creates phase incoherence issues (this is evident in audible digital artifacts and in some cases the manipulated/reconstructed signal is clipped and completely
unusable).

In my case, the STFT analysis is done using overlapping frames, which were windowed (e.g Hann, Hamming etc) prior to the FFT.
This alone (the overlapping and windowing) creates phase incoherences, and the problem is further compounded by
manipulating spectral content.

So, are there any standard ways/strategies to deal with this kind of situation?

Thank you


texts: Adding Noise in Frequency Domain vs Time Domain

texts:
I am trying to analyse the effects of SNR level on my data.
I have a set of signals in frequency domain with f_min = 0.5GHz and f_max = 10.5GHz centered at f_c = 5.5GHz. These are simulated signals and are noisless (ideal data). Using the awgn function of MATLAB, I add noise of various SNR levels (SNR = 10, 20, 30, 50 and 60dB) in frequency domain. I now need to add the same level of SNR to their time-domain counterparts.

I came across something which I didn't quite understand. It goes as follows :
SNR_freq is computed from the data over the whole frequency,
while in practice, SNR_time matched to pulse data and is computed from the peak of the signal magnitude (A_max) as shown below :
SNR_freq = 10*log10(E/sigma^2)
SNR_time = 20*log10(A_max/sigma)
where sigma is the variance of the signal.

what exactly is the relationship between SNR_time and SNR_freq?


texts: Express Circular Convolution in Terms of Linear Convolution

texts:
g[n], h[n] : finite length sequences of length 7
yC[n]: circular convolution
yL[n]: linear convolution

Express yC[n] in terms of yL[n].

If same two sequences of equal length are convolved using both linear(by tabular method) and by circular(matrix method) the output is of differing length and values.

How can I possibly relate circular convolution to linear convolution?


texts: Orthogonality of FSK modulation for non-coherent detection

texts: For an FSK modulation with coherent detection, in order to ensure orthogonality, the frequency separation between symbols is $ \Delta f=f_2 - f_1 =1/2T$. However, in case of non-coherent demodulation, which must be this value $1/2T$ or $1/T$?


texts:
I'm currently studying a decision directed carrier recovery scheme. Basically a PLL try to estimate the phase error in the current received symbol, the phase detector compensate the incoming symbol's phase with the estimated one and then the result is multiplied my the complex conjugate of the decision taken.
My notes say:

  Another phenomenon that should be taken into account is the phase ambiguity of $n \pi/2$ that affects the decisions with conventional QAM constellations.

What is he talking about? I don't understand why he tells that there is phase ambiguity in the decision of a QAM symbol.
Also citing Wikipedia:

  Most QAM constellations also have $\pi/2$ phase symmetry

To me there is no phase ambiguity, in fact if I have a 4-QAM with 1 symbol in each quadrant I can just sample the I and Q branch after a matched filter and than perform a simple unambiguous atan like this:


texts:
We had a lecture on digital watermark detection using linear correlation. Here it was explained that the linear correlation of two vectors is equal to their scalar product divided by the dimension. So, the larger the scalar product, the larger the linear correlation.
This is not true, is it?
Simple example:
u = [1,2,3,4]
v1 = [10,10,10,10]
v2 = [0, 1,2 3]

The scalar product u*v1 would be way bigger than u*v2, but obviously, there is a perfect correlation between u and v2 ?
Can anyone guess how the statement was to be understood?
Thanks!


texts: Do high frequency oscillations use more than one bandwidth

texts:
Please excuse me for asking such a basic question. I was having a look at how AM radio works. So there is a carrier frequency and a higher frequency inside that that carries the data.

Does this mean that there would be two frequencies, one high and one low?

What about for stuff like 3G/GSM when stuff is sent over EM would it create noise at other frequencies, say out of their licensed spectrum?

If not how do they squeeze it all into such a tiny band of frequencies?