texts: On computing the number of independent values from a signal's bandwidth?

texts:
Can anyone help me understand where the value of $2$ comes from in the following statement?

A time function t whose frequency response is white out to a bandwidth B has
about 2 · B · T independent values when measured for the time interval T.

This is in the context of a serial stream of digital (e.g. binary) data. The function t represents this data stream.


texts: inverse fourier transform of magnitude and phase

texts:
I stuck this question. Frequency response is written as magnitude and phase and I don't find inverse fourier given signal which as magnitude and phase.How can I solve it ? Can you explain the solution way in order? magnitude of signal is : y=−ω while −1≤ω<0,
y=ω while 0≤ω<1 phase of signal is: y=−3ω

What is the Fourier transform? I mean I have phase and magnitude information of a signal that has been transformed from fourier. I want to find inverse fourier transform. And phase and magnitude information are above


texts: Ways to differentiate three respiratory signals

texts:
I have three 1-min respiratory signals I derived from ECG signals. I am wondering if you guys have any suggestion on differentiating those three? The red line represents the experimental signals and the blue ones are the computational results. Clearly, the second one is more representable than the other ones but I am not sure how I can differentiate it programatically or mathematically. I am not really asking for a specific way to process it. More like specific features that can help differentiate different waves below.

Any suggestions??


texts: Why when you use any filter, it results first a steepness at the beginning to a certain level?

texts:
Is there any tool to avoid that? For instance, I wish after filterin my signal, the filtered signal start from a certain level, in other words, at the offset level.

In this case, I've use Butterworth, second order, freq cut-off at 0.1 Hz and sample rate at 34 ms.


texts: Are Amazon Echo ads embedding an ultrasonic signal to suppress recognition of the Alexa keyword?

texts:
Related to High audio frequencies in television broadcast

My cell phone samples at 48000 samples/sec so the FFT app I installed can only detect frequencies up to 24 kHz.

If anyone has an audio frequency analyser that can go higher, would you please use it on a digital TV advertisement for Amazon Alexa and see if they are embedding any sort of ultrasonic signal to tell the device not to respond to the keyword?

When it first came out it responded to the word Alexa on TV all the time and now it almost never does.  My guess is an ultrasonic signal is being used to suppress the keyword recognition.  No-one has talked about this online or in the press that I can find, so I'd like some confirmation if this is true.  (I can't see any other way they would be doing it that doesn't involve sending samples to Amazon which they should not be doing since the recognition light is not activating at all for these events)

So my question is whether an ultrasonic signal is present in Alexa TV ads and if so, what is it composed of?


texts: applying single pole filter to simple signal

texts:
How to apply single pole filter to simple signal

fs = 500;
ts = 1/fs;
t = 0:ts:1-ts;
fc = 50;
S = cos(2*pi*fc*t);


texts: Is there any relation between QAM and streaming?

texts:
I am trying to determine whether there is any relation between QAM and streaming (e.g., video streaming).

I know that QAM can be used for broadcast TV.  I'm not sure if QAM is used for WiFi bit streams or whether streamed video may be sent using QAM.

I greatly appreciate any insight on this.  Thanks!


texts: Should I ever pick the continuous wavelet transform over the discrete one? DWT vs CWT vs STFT

texts:
Of course I mean in terms of numerical algorithms.

I'm reading various papers on the wavelet transform and why it's better than the short-time Fourier one. The reason that's cited more often is that the WT detects transients of known shape better than the STFT.
In other sources I read that the DWT is essentially a faster version of the CWT. But so far all the MATLAB algorithms I've seen for scaleograms and transient detection have been using the CWT. Is there any specific reason for this?

In general, when should I code a CWT and when - a DWT?

Thanks in advance.


texts: Problems designing high pass FIR filter with $f_\textrm{cutoff} \ll f_\textrm{s}$

texts:
Is there any inherant problems with high-passing a signal with a very low cutoff frequency compared to the sampling rate?

I'm not sure what I am missing as I cant find any info on it.

Examples with gives bad results:

sample_rate = 250
nyq_rate = sample_rate / 2.0
f_hp_freq = 0.1
f_hp_transition = f_hp_freq + 0.1
numtaps = 125
b = signal.remez(numtaps, [0, f_hp_freq, f_hp_transition, nyq_rate], [0, 1], Hz=sample_rate, type='bandpass')

or

b = signal.firwin2(125, [0, f_hp_freq, f_hp_transition, nyq_rate], [0, 0, 1, 1], nyq=nyq_rate)

by reducing the sampling rate to less than $10\textrm{ Hz}$ or by significantly increasing the filter order < 1000 I can get acceptable results, but no other way.
What am I overlooking?


texts: filtering difference b/w freq and time domain

texts:
When you want to get the specific frequency (ex. around 1000Hz), you might

take FFT, remain the frequency you want, and reduce the power of the other frequencies you do not.
ex.) if fs=16khz and fftsize=1024, remain the power of bin64 and reduce all other bins
design band pass filtering (Butterworth or others) to pass 1000Hz (with stop/transition band also)

In short, 1 is in frequency domain, and 2 is in time domain.
Then my question is: are these two methods same?
(I think yes in terms of "extracting 1000Hz signal"(Both can do))
If yes, how would you utilize these two methods?
If not, how different are these (and how would you utilize)?
I would appreciate your answers. Thank you.


texts: Addition of two signals in polar coordinates

texts:
There is quadrature detector which receive radio signal and return its amplitude and instantaneous phase after performing hilbert transformation and transferring the signal to zero frequency. The main purpose of this device is save information about phase of received signal after digitizing (here is example of such receiver). Simplified structure of such detector shown below:

The following octave code try emulating the detector (I'm not sure that is correct):

% Prepare to work.
close all;
clear all;
clc;

% Main constant.
frequency_local_oscillator = 30e6;
frequency_intermediate     = frequency_local_oscillator;
frequency_sampling         = frequency_intermediate * 4;
time_begin                 = 0;
time_end                   = 10e-4;
time                       = linspace (time_begin, time_end, frequency_sampling * (time_end - time_begin) );
size                       = length (time);

% Pulse.
magnitude_pulse            = 1.0;
phase_pulse                = 0;
carrier_pulse              = magnitude_pulse * cos (2 * pi * frequency_intermediate .* time + phase_pulse);
timeshift_pulse            = time_begin + (time_end - time_begin) / 4;
duration_pulse             = (time_end - time_begin) / 2;
envelope_pulse = zeros (1, size);
envelope_pulse = envelope_pulse + heaviside (time - timeshift_pulse) .* heaviside (duration_pulse - time + timeshift_pulse);
signal_pulse   = carrier_pulse .* envelope_pulse;
if 0 % Make signal more realistic.
% Noise.
magnitude_noise            = 0.01;
carrier_noise              = magnitude_noise * randn (1, size);
signal                     = signal_pulse + carrier_noise;
else
signal                     = signal_pulse;
end

% Moving to zero frequency and and quadrature detection.
signal_i =  signal .* cos (2 * pi * frequency_local_oscillator * time);
signal_q = -signal .* sin (2 * pi * frequency_local_oscillator * time);

% LPF.
[b a] = ellip (4, 0.1, 60, 0.1);
signal_i_filtered = filter (b, a, signal_i);
signal_q_filtered = filter (b, a, signal_q);

% Decimation (performed at two stages with common ratio: 15 х 16 = 240).
signal_i_decimated = decimate (signal_i_filtered,  15);
signal_q_decimated = decimate (signal_q_filtered,  15);
signal_i_decimated = decimate (signal_i_decimated, 16);
signal_q_decimated = decimate (signal_q_decimated, 16);
% Time scale after decimation.
time_decimated = linspace (time_begin, time_end, length (signal_i_decimated) );

% Magnitude and instantaneous phase.
signal_magnitude = sqrt  (signal_i_decimated .^ 2 + signal_q_decimated .^ 2);
signal_phase     = atan2 (signal_q_decimated, signal_i_decimated);

% Display signal.
figure;
grid on;
subplot (2, 1, 1);
plot (time, signal, 'b');
hold on;
plot (time, envelope_pulse, 'r');
title ("Input signal.");
xlabel ("Time [s].");
ylabel ("Magnitude [V].");
subplot (2, 2, 3);
plot (signal_magnitude, 'b');
title ("Magnitude of the signal.");
xlabel ("Sample number.");
ylabel ("Magnitude [V].");
subplot (2, 2, 4);
plot (signal_phase, 'g');
title ("Phase of the signal.");
set (gca, 'YTick',     -pi: pi / 2: pi)
set (gca, 'YTickLabel',{'-pi', '-pi / 2', '0', 'pi / 2','pi'})
xlabel ("Sample number.");
ylabel ("Phase [rad].");

Here is result of the code which looks in my opinion more or less real:

Question:
I have records of two different signals from output of the detector (desired signal and noise). And now I'd like to adding those signals (combine as if they was received simultaneously). Is it possible to do it and how can I do this?
The main purpose of this task is performing measurements of the the once recorded signal with different calibrated noises.

My attempts:
About possibility I think it's possible if all stages of the detector are linear. If it is true this allows swap processing stages.

In my opinion add together magnitudes and phases of signals is wrong. I think that this task can be solved with the following steps:

revert conversion at I and Q;
get sum of components of two signals;
convert I and Q to magnitude and phase again.

Am I right?


texts: Should you scale the FFT bins by $1/N$ where $N$ is the number of points in a transient signal?

texts:
I am going over the following tutorial. In section 2.1 the author says

  To calculate the $N$ point FFT the Matlab algorithm 1 can be used. Here, after taking the FFT, its magnitude is calculated and the bins are scaled by $1/N$.

Now the author doesn't explain as to why the bins are scaled by $1/N$. At first glance it looks like some kind of normalisation -- but why?

I did some further research and it seems there different ways to define the power in a signal, depending on what you are looking at. See slide 3 of this.

  http://www.hep.ucl.ac.uk/~rjn/saltStuff/fftNormalisation.pdf


texts: Capacity region of 'symbol asynchronous' Gaussian multiple access channel

texts:
I was interested to learn what theoretical limits have been determined so far for the 'multiple access channel' with additive Gaussian noise. This brought me to the 1989 paper by Sergio Verdu, named "The Capacity Region of the Symbol-Asynchronous Gaussian Multiple-Access Channel". Found it here.

If anyone here is familiar with this area, can you help clear up a confusion I am facing regarding what Figure 7 and Figure 5 in this paper seem to be saying?

Say there are two transmitters 1 & 2, and the noise  is $N$. The 'capacity region' to be the set of all possible combinations of $R_1$ and $R_2$, and can be drawn in a graph of $R_1$ against $R_2$. In such a graph, the 'Cover-Wyner pentagon' is defined as all points satisfying the following:
$$
R_1 \le {1 \over 2} \log {\left( 1 + \frac {P_1} {N}\right)} \\
R_2 \le {1 \over 2} \log {\left( 1 + \frac {P_2} {N}\right)} \\
R_1+R_2 \le {1 \over 2} \log {\left(1 + \frac{P_1+P_2}{N}\right)} \\
R_1 \ge 0 \\
R_2 \ge 0
$$

Now my understanding of the conclusions of the paper is that the capacity region coincides with the Cover-Wyner pentagon when one of the following is true:

The two users are exactly symbol synchronous
The two users are symbol asynchronous, but both transmit the same waveform.

The Cover-Wyner pentagon makes intuitive sense to me because, as long as the rate sum $R_1+R_2$ is within that pentagon, no single user can 'pretend to be' two users and obtain a total rate higher than the Shannon capacity ${1 \over 2} \log {\left(1 + \frac{P_1+P_2}{N}\right)}$.

However, then the paper goes on to illustrate two cases where the rate sum seems to be higher than ${1 \over 2} \log {\left(1 + \frac{P_1+P_2}{N}\right)}$ as follows:

In Figure 5, where the symbol timing of the two users are offset by exactly half symbol duration.
In Figure 7, where the users are totally asynchronous, the waveforms transmitted by the two users are different, and the waveforms would be orthogonal if they were to be synchronous.

My question is, this apparently seems to create a 'loophole' by which a single user can divide its transmit power between two 'virtual' users, and end up with a rate that is higher than the upper bound of the channel capacity ${1 \over 2} \log {\left(1 + \frac{P_1+P_2}{N}\right)}$. Since that can't be possible, what am I missing here?

Or am I mixing up my understanding of the 'discrete time Gaussian channel' with the 'continuous time Gaussian channel' in some stupid way?

Thanks...


texts: What is SNR of Signal with Additive White Gaussian Noise

texts: Calculating the power of AWGN should be equal to infinity as PSD is constant and its integration is infinity over all frequencies. Hence for any signal with finite power mixed with AWGN, SNR should zero. But this doesn't seems right??


texts: Using morphological operations for color images processing

texts: Have you ever seen any articles about using morphological-like technique for denoising color images?


texts: How to interpret the window size and FFT size while performing FFT?

texts:
I have a discrete signal of length 98,000 samples and I am supposed to a FFT of the discrete signal with certain window size and FFT size. Can someone help me explain what is meant by the window and the FFT size here?
Also, what would the size of the output of the signal post FFT?

Thanks in advance!


texts:
Let's say I have a signal, containing frequencies up to $30$ kHZ.

I am sampling this signal at $40$ kHz with infinite bit depth (just for theory).

Will I be able to recover exactly all the frequencies up to $20$ kHZ , or is that the signal must  only contain frequencies below $20$ kHZ to get the exact magnitudes of the frequencies up to $20$ kHZ ? In other words, will frequencies above $20$ kHZ introduce uncertainty about those below $20$ kHZ ?


texts: SNR calculation in audio reconstruction and what is an acceptable value

texts:
I have the original signal, a .wav file and by blind source separation, i have reconstructed the signal.
How can I calculate the SNR in this case? or is it good to use any other performance parameters? What should be an acceptable value of SNR?


texts: response of algorithm in non-equidistant time

texts:
We are investigating ways to test a control algorithm.  The algorithm has a non-equidistant track of input data (i.e. not every sample is valid, and we know it), and should output a series of correction factors.

Under a certain frequency, it should correct for a deteriorating light source.

Is there a way to black-box test the algorithm's transfer function?  I'm having trouble especially with the fact that it's non-equidistant.

The goal of the tests would be to have a clear idea on the algorithm's behavior in terms of

delay/phase response
resonances
frequency response

So I was actually dreaming of a kind of a 'swept sine' test, or an impulse response, or something alike, but I'm a bit lost in what is feasible with non-equidistant signals.


texts: How can I find the amplitude of the 20 Hz frequency component of a signal faster?

texts:
I have a time varying discrete signal x(t) sampled at 5ms rate.
I need to find the amplitude of the 20 Hz frequency component for each sample.
What I do today is that for each sample I do a Short-time Fourier Transform of the data in a window around that sample. Then I read the amplitude for the 20 Hz frequency component off the  amplitude spectrum.
This seems to work fine, but it is slow.

How can I speed up this process?
For instance I am only interested in the 20 Hz component. Is there some way I can avoid finding the complete amplitude spectrum (that is faster than FFT)?


texts: Root Locus, Transfer Functions and Unit Step Response?

texts:
Consider the generic feedback loop, and the transfer function $G(s)$ shown by the following root locus plot.

Where $\mathbf{x}$ denotes the open-loop poles and $\square$ denotes the closed loop poles.
I want to determine if this root-locus produces any of the following output responses to a unit step reference signal:

Attempt:
I attempted to build the open loop transfer function:
$$G_{OL} = \frac{K}{s^2+2s+2}$$
Find the value $K$ using the FVT for the step response and graph a)
$$\lim_{s\to 0} = s\cdot\frac{1}{s}\frac{K}{s^2+2s+2} = 1$$
which gives $K = 2$, plug this back in and see if the step response matches any of the figures. It is possible none of the figures match, but I think I am doing something incorrect.
Root locus shows all the possibilities of K, but I am also given the closed loop poles. Can I use those to get K? Is the unit step response in relation to the Closed Loop Transfer Function? or the open loop? I can see that building the connection between the graphs is important, I seem to be missing something though. Thanks!
Edit/Update
I believe the corresponding Step Response Graph is C) but I'm still uncertain on if I followed the right process: Finding the closed-loop transfer function I get
$$G_{CL} = \frac{K}{s^2+2s + 2 + K}$$
Applying FVT to graph C I get $K = 3$, which makes
$$G_{CL} = \frac{3}{s^2+2s + 5}$$
and plotting the unit step response with Matlab gives C). What if I didn't have access to Matlab? Is there an easier way? Is it sufficient to match the closed loop poles after I determine $K$?


texts: Fir filter not working according to frequency response

texts:
I have designed a FIR filter with following parameters

fs=30,
f_pass1 = 1, stop1 = 0.5, f_pass2 = 3, f_stop2 = 4,
A_pass = 1,A_stop = 40

Here is code :

fs_filter=30;

f_pass1 = 1; %1.2
f_stop1 = 0.5;%0.7

f_pass2 = 3;
f_stop2 = 4; %6

A_pass = 1;
A_stop = 40;

del_f1 = -f_stop1 + f_pass1;
del_f2 = f_stop2-f_pass2;

del_f = min(del_f1,del_f2);

fc1 = f_pass1 -(( del_f)/2);
fc2 = f_pass2 +( (del_f)/2);

w_c1 = (2*pi*fc1)/(fs_filter);
w_c2 = (2*pi*fc2)/(fs_filter);

S_pass = ((10^(A_pass/20))-1)/((10^(A_pass/20))+1);
S_stop = 10^(-A_stop/20);

S = min(S_pass ,S_stop);

A = -20*log10(S)

alpha =0;
D = 0.922;

if A > 21 && A < 50
    alpha = 0.5842*((A-21)^0.4)+0.07886*(A-21);
    D = (A-7.95)/14.35;
elseif A>=50
    alpha = 0.1102*(A-8.7);
    D = (A-7.95)/14.35;
end

N = floor(((D*fs_filter)/del_f)+1);

N = N + mod(N-1,2)

M = (N-1)/2;

coeff= zeros(1,N);
w   = zeros (1,N);
d   = zeros (1,N);

for i=0:N-1
    x_b= sqrt(1-(((i-M)/M)^2));

    w(i+1) = besseli(0,(alpha*x_b))/besseli(0,alpha);

    if i ~= M
    d(i+1) =((w_c2/pi)*(sin(w_c2*(i-M)))/(w_c2*(i-M)))-((w_c1/pi)*(sin(w_c1*(i-M)))/(w_c1*(i-M)));
    coeff(i+1) = w(i+1)*d(i+1);
    else
    d(i+1) = ((w_c2-w_c1)/pi);
    coeff(i+1) = w(i+1)*d(i+1);
    end

end

fft_coeff = abs(fft(coeff));
num_bins = length(fft_coeff);
bins = 0 : num_bins-1;
bin_Hz = bins*fs_filter/num_bins;
N_2 = ceil(num_bins/2);

plot(bin_Hz(1:N_2) , fft_coeff(1:N_2),'x');

but when i am convoluting it with the sin wave of say frequency f ( 0.1 to 5) sampled at fs = 50 the output of the signal is not actually following the response.

Code for generating signal :-

    fs=50;
    f0 = 0.6593;
    cyc = 50;
    t = 0:1/fs:cyc/f0;
    x = sin(2*pi*f0*t);
    y = conv(x,coeff,'valid');

am i missing something ?


texts:
I'm having some trouble understanding FFT plots and measures.

According to this, this will give me the magnitude plot of FFT, but I want the area under from 1 to 10 Hz for example.

Is this next formula I made right?

My doubt is, what's the relation between Hz and rad/s, f and w?


texts:
I would like to know the impact of the time jitter of the clock driving an ADC on the appearing phase noise while sampling a sine wave. Of course, with strong the clock jitter, the sampled sine wave seems to exhibit more and more phase noise. But how much ?
  Regards,
     Mike


texts: Got stack in calculating state-space representation

texts:
I got stack in the process of deriving a state-space representation of the following system:

There is an electrical oven described as follows:

control of the power supply $u$,

heating efficiency constant  $v$,

oven-product convection constant $p$,

oven-cover convection constant $c$,

cover-air convection constant $a$,

heater heating power $H$,

heating entering the product $P$,

heating entering the oven’s cover $C$,

heat loss to the surroundings $S$,

temperature of the product $y$,

temperature of the oven $T_o$,

temperature of the oven’s cover $T_c$,

temperature of the surrounding air $T_a$,

$$P = p(T_o−y),$$

$$C = \frac{c(T_o−T_c)}{10}, $$

$$S = a(T_c −T_a),$$

$$H = vu,$$

$$3\dot y  = P,$$

$$\dot T_o = H−P−C,$$

$$3\dot T_c = C−S$$

State variables are $y, T_o, T_c$,

Input is $u$.

On the left side I placed derivatives of state variables:

$$\dot y = \frac 13 pT_o - \frac 13 py$$

$$\dot T_o = uv - pT_o + py - \frac{c}{10}T_o + \frac{c}{10}T_c$$

$$\dot T_c = \frac{c}{30}T_o - \frac{c}{30}T_c - \frac a3T_c + \frac a3T_a$$

Let $x_1 = y, x_2=T_o, x_3=T_c$

$$\dot x_1 = - \frac 13 px_1 + \frac 13 px_2 $$

$$\dot x_2 = px_1 - (p+\frac{c}{10})x_2 + \frac{c}{10}x_3 + uv$$

$$\dot x_3 = \frac{c}{30}x_2 - (\frac{c}{30}+\frac a3)x_3 + \frac a3T_a$$

$$ \begin{bmatrix} \dot x_1 \\ \dot x_2 \\ \dot x_3 \end{bmatrix} =  \begin{bmatrix}
 -\frac 13p & \frac 13p & 0 \\
p & -(p+ \frac{c}{10}) & \frac{c}{10} \\
0 & \frac{c}{30} & -(\frac{c}{30}+\frac a3)
\end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} + \begin{bmatrix} 0 \\ v \\ ??? \end{bmatrix} u $$

The question is: what should be placed in ??? ?

Should it be $\frac a3T_a$? It is not connected with $u$.

And what to do with $\frac a3T_a$? Is it another input or should I erase it?


texts: Huffman coding for $8\times 8$ blocks of an image

texts:
I have a question regarding the Huffman coding in Image processing. In order to compress the signal, we usually operate on $8\times 8$ pixels (blocks) on which we perform DCT, zig-Zag scan, quantization then construct the alphabets using run-length encoding (RLE). After all of that, we do Huffman coding.

My question is: Do we have to compute and store the Huffman tree/table for each block separately and augment it to the bit stream of the block or we compute the frequency of the alphabets in all the blocks jointly and do Huffman coding only once at the end (this saves the memory needed to store different table/tree for each block).

In other words, isn't it almost useless to use Huffman coding on only $64$ coefficients ($1$ block) and save the table with data stream (which consumes memory)?


texts:
Now K(s) is obviously the negative feedback loop which is ${H(s) \over 1+H(s)G(s)}$

When I substitute ${H(s) = {1 \over s-2}}$ I get  K(s) = ${ 1 \over s-2 +G(s) }$

For the system to be stable I know that the poles have to be on the negative half of th imaginary plane. Not sure how to find G(s).


texts: Sparse Channel Estimation in OFDM System

texts:
Compressive sensing methods are used in channel estimation when the channel is thread as sparse where there are zero points in the signal representation.
I am in the beginning of the sparse signal processing and trying to understand how to model the sparse channel in the equation below.

Y(k)=H(k)X(k)   === > Y(k) received signal in frequency domain

My questions are:

1-What is the presentation of sparse channel h in this equation?
2-How to define the dictionary matrix for sparse channel?
3-For sparse estimation do we need to insert pilot symbols into the transmitted data x(n)?
4-Do you have a reference which explains the sparse channel properties in OFDM systems?

I would appreciate if someone please help on this topic.

Many thanks!


texts: How does taking the absolute value of a complex signal reflect in the frequency domain?

texts:
I have a frequency-domain representation $X(e^{i\omega})$ of the complex discrete one-dimensional signal $x[n]$: $X(e^{i\omega})=\mathcal{F}\{x[n]\}$. Is there a frequency-domain transformation of $X(e^{i\omega})$ into $\hat{X}(e^{i\omega})=\mathcal{F}(|x[n]|)$?

Obviously, $\hat{X}(e^{i\omega})=\mathcal{F}\left\{\left|\mathcal{F}^{-1}\{X(e^{i\omega})\}\right|\right\}$ will do the trick, but I am interested if there is a dual to the absolute value function $|x|$ in the frequency domain.


texts: Converting a simple analog Butterworth filter into a digital filter

texts:
I was just studying an old circuit analysis textbook that was describing how to design a Butterworth filter, and that seemed easy enough.. then, I started to wonder if I can take this analog filter and convert it into a digital filter. Its not really an exercise in the textbook, i was just curious how to convert the analog filter into a digital filter just for fun without the heavy DSP theory.

So I was tried to taking a toy Butterworth filter to do just that.  For example, Let's suppose I had an analog filter:

$$H_a(j\Omega) = \frac{1}{(1+j\Omega)(2+j\Omega)}$$

and i wanted to convert this into a digital filter with say a sampling period $T=200\pi$ rad/sec, and neglecting the effects of aliasing, using this formula:

$$H(e^{j\omega}) = H_a(j\Omega)\Big|_{\Omega = \omega/T}$$

What would $H(z)$ and $h[n]$ look like for the digital filter?


texts:
I am currently working with a USRP B200 mini-i to receive 802.11 signals from various usb wifi devices. When sending packets with the USB device over a channel, lets say 2.412GHz, i can't really see pakets that look like a typical OFDM signal (e.g. with the distinctive preamble). What I rather see is some strange looking signals like seen here

These signals only show up if I am transmitting with the USB device so it is pretty shure that these signals are coming from the device. Also communication works fine between two usb devices so I assume they are not broken.
Does someone know what that is? It is saturating the whole rx-end. I tried different sampling rates (10, 20, 40 and 50 Ms/s) and different frequency channels for transmission and reception. I tested several different usb devices and they all show a similar kind of pattern. My Idea was that this is some kind of bad side emission of the device but its amplitude is pretty high.
Just a hint would be awesome !

Cheers Lucas


texts: Distortion in phase difference measurement using FFT

texts:
I am doing distance measurements by transmitting a 100 kHz tone and receiving it and measuring the phase difference.The distance is simulated by a delay simulator which is very precise (around 10 psec)
The 100 kHz tone is PM(Phase not PSK) modulated with an index of 1.1 rad and upconverted to 70 MHz. Then it is received downconverted and demodulated.
Everything seems fine except the phase difference varies within 0.15 degrees which is quite high as the tone has a high SNR >30 dB.
The steps leading to obtaining the phase difference are:

Sample the received 100 kHz tone at Fs= 10 MHz.
Take 32768 samples.
Apply Blackman-Harris window on the received samples.
Apply FFT with a length of 32768 on both the received samples and the reference tone.
Find the bin of the received and the reference tone: major_bin = floor(100000 * 32768/ Fs)=floor(327.68)=327
Find the phase of both the received and reference tones using:
atan(imaginary_fftsample[327]/real_fftsample[327])*180/pi
Subtract the phases to get the difference and calculate distance.

At this point I get variations in phase difference around 0.15 degrees while there is no change in the distance.
I suspect there is something wrong with the steps above. I don't want to use a PLL instead FFT.
Any ideas?


texts: Why does the Stationary Wavelet Transform shift this image?

texts: I am running a stationary wavelet transformation on a brain image. I can't understand why it shifts with each level so that the image is no longer centered. You can see that the X component shifts to the right, the Y to the bottom, the diags up and to the left. This makes it hard to reach my goal of using the SWT to detect edge activity at each scale, as it looks like I will have to re-align the images to do the calculation. Why is it like this?


texts: I have a set of images with red, round labels on it. What I want is, to get pixel location of each of the label. One way, of course, would be to search for red color pixels. But the problem is, sometimes light reflexes from the marker and changes it's color. But you could still detect round "redish" circle. It there any efficient way to get this?


texts: Histogram Equalization - mapping a certain portion of pixels to pure black and white

texts: How can I make sure to map, for example, 7% of the pixels to pure black (0) and pure white (255) in a grayscale image?


texts: Normalizing directed graphs from image space to compute joint differences

texts:
My question is how to transform a 'skeleton' (directed graph) from image space so that I can compare it joint-wise against another 'template' or reference skeleton that may be differently sized/proportioned, etc., and produce a set of distances/deltas between their joints (or vertices in maths terminology).
I am assuming they have the same joints, are both recorded from the same camera (so the skeletons are from the same image space), but not necessarily the same distance from the camera, height/build, etc. Naively computing distances would not be valid, since that doesn't take different height/proportion into account.
Let's say a skeleton, denoted ST, can be defined like so:
$$
ST = (\hat{x}_j; j = 1,...,n)
$$
where $\hat{x}_j$ is the jth joint position in image space and $n$ denotes the number of joints.
I know I can normalize a skeleton like this in at least one way, by normalizing edges and converting to polar/spherical coordinates (set a joint as the origin $r_1 = (0, 0)$ or $r_1 = (0, 0, 0)$ if 3D) and for all other joints $r_j$:
$$
r_j = \frac{\hat{x}_j - \hat{x}_{j_o}}{\lvert\lvert\hat{x}_j - \hat{x}_{j_o}\rvert\rvert_2}
$$
where ${j_o}$ is the parent joint of joint ${j}$ (for joint $r_1$ it would be its own parent). This kind of normalization removes the concept of units, but the relative lengths w rt to each other remain the same.
But if I normalized two skeletons with different heights, would this kind of normalization enable a valid joint-wise comparison, or not? Do I need to scale one by the other, instead of or in addition to the above normalization? My hunch is yes, to remove proportional differences (e.g. skeleton $ST$ has longer arms compared to legs and the template $T$ has the opposite). I have in mind something like this where $\lambda$ represents a scaling term:
$$
\lambda(j, j_o) = \frac{{{\lvert\lvert \hat{x}_j - \hat{x}_{j_o} \rvert\rvert}_2}}{{\lvert\lvert T_j - T_{j_o} \rvert\rvert}_2} \\
r_j = \frac{\hat{x}_j - \hat{x}_{j_o}}{\lvert\lvert\hat{x}_j - \hat{x}_{j_o}\rvert\rvert_2} \lambda(j, j_o) = \frac{\hat{x}_j - \hat{x}_{j_o}}{{\lvert\lvert T_j - T_{j_o} \rvert\rvert}_2}
$$
where $T_j$ denotes the jth joint of the 'template' skeleton to compare against. Not sure if I want the reciprocal of $\lambda$ instead, which would give:
$$
r_j = \frac{(\hat{x}_j - \hat{x}_{j_o}){\lvert\lvert T_j - T_{j_o} \rvert\rvert}_2}{{{\lvert\lvert \hat{x}_j - \hat{x}_{j_o} \rvert\rvert}_2^2}}
$$
Please let me know if there's any way I can improve this question and thanks in advance for any advice/suggestions. If you think this would be better answered in a different StackExchange network please say which one. I asked in the Mathematics one but since this is related to computer vision maybe this one makes more sense.


texts: What happens when we reconstruct a signal after its Fourier transform is done and some frequencies are altered?

texts: Since we loose time information when we take a Fourier transform, what happens if we alter a few frequencies from the transform and then reconstruct the signal, do we get the altered frequency at the exact place the original frequency was(in time). Would it be beneficial if we use Wavelet transform or FFT? If yes, how?


texts: Gaussian filter convolution giving unexpected results

texts:
I am trying to smooth a time series signal with a Gaussian filter and then differentiate the signal (this is for an application for edge detection). A nice property of convolution is:
$$
\frac{d}{dx} \left( s(t) * g(t) \right) = \frac{ds(t)}{dt} * g(t) = s(t) * \frac{dg(t)}{dt}
$$
When $g(t)$ is a Gaussian kernel, $dg(t)/dt$ is analytically computable and so I don't need to use any finite differences to compute $ds(t)/dt$. But in doing some numerical tests on the above equation, I found some curious differences between the right-most equality in the equation above. The following matlab code illustrates the problem.

It defines a simple sine wave signal $s(t) = sin(t)$, then computes a 211 point Gaussian kernel along with its derivative. It then convolves $s(t)$ with $dg/dt$ and then convolves $ds/dt$ with $g(t)$ and compares the solutions. I would expect the solutions to be identical based on the known result above, but surprisingly I find small differences between the two solutions. Can anyone shed any light on what is going on?

h = 0.001;    % step size for signal
K = 211;      % window size of gaussian
sigma = 0.25; % stddev of gaussian window

% define signal and its derivative
x = -pi:h:pi;
signal = sin(x)';
dsignal = cos(x)';

% make Gaussian window, size K
L = K - 1;
n = [-1:2/L:1]';
g = exp(-(1/2)*(n/sigma).^2);

% now its derivative
dg = -(1/sigma^2/(L/2)) * n .* g / h;

% normalize so convolution has unit gain
w = g / sum(g);
dw = dg / sum(g);

% compute sol1 = d/dx signal(x) * G(x)
sol1 = conv(dsignal, w, 'same');

% compute sol2 = signal(x) * dG(x)/dx
sol2 = conv(signal, dw, 'same');

% plot solutions - they are visually identical
plot(x,sol1,x,sol2+1e-2)

% ...but this tells another story
r = sol1 - sol2;
rmsdiff = sqrt(dot(r,r) / length(r))
maxdiff = max(r)
mindiff = min(r)

The output of the matlab code is:

rmsdiff =
     9.266306205125738e-04
maxdiff =
     9.940615138074316e-04
mindiff =
  -0.008096374978515

where I'd expect all of these to be zero. A plot of the two solutions, offset by a small epsilon is below.

So the two solutions look the same, but in fact have small differences. Since everything in the script uses analytic results (no finite differencing), I would expect the two solutions to be identical. Can anyone explain why they are not?


texts:
In the literature on the short-time Fourier transform (STFT) it is often stated or implied that the constant overlap-add (COLA) constraint must be satisfied in order for the STFT to be invertible.

Example: https://ccrma.stanford.edu/~jos/sasp/FBS_Perfect_Reconstruction.html

People seem go to a lot of trouble to choose a window/overlap combination that satisfies COLA.

I'm challenging the community here to "change my view" that the COLA constraint is sufficient but not necessary. I contend that you can achieve perfect invertibility under much weaker conditions and so have access to a very broad range of windows and overlaps.

I've written this blog post to examine this question. I would love to know if I am missing something.

This script provides an example of a window that is not COLA compliant, but which creates an invertible STFT.


texts: What Are Intuitive Explanations for Shrinkage in the Context of Image Denoising?

texts:
I have occasionally come upon the term "shrinkage", mostly in the context of denoising methods.
My rough understanding is that it refers to the part where the real distribution might not be exactly like the theoretical one that's being modeled while still being relatively similar (e.g. mostly Gaussian with some outliers), and to the fact that "shrinkage factors" are introduced/estimated in statistical estimators to counter that and have a "better" estimation (for a given definition of "better" that's probably not always the same depending on your goal).
The Wikipedia page gives out the example of the sample/population variances and hints at the fact that using $\frac{1}{n-1}$ or $\frac{1}{n}$ depends on the shape of the distribution, but it's hard to have a good idea of why I should choose one or the other.
How can I put that more intuitively? Can you point me towards other examples that may help me form a bigger picture of this concept?


texts: Finding the frequencies given in a wav file

texts:
I have a wav file containing a series of chords, each containing 3 or 4 notes, played concurrently.

I need to find the frequencies of each note in each chord, and I can use matlab to do any computation.

Currently I think I need to find the spectrogram of the wav file and convert the frequencies from normailsed frequencies to normal frequencies (I know the sampling rate). Here is the spectrogram:

Is this a good approach to solving this problem?

I've already tried it, but the spectrogram isn't particularly informative. Is there an alternative method that I'm ignoring?


texts: $\mathcal Z$-transform, ROC of a system from dividing to others

texts:
TRUE / FALSE

Given three systems with rational $\mathcal Z$-transform. Systems A and B are not stable with $\mathcal Z$-transform $H(z)$, $G(z)$ respectively. A and B have no common poles. System's C $\mathcal Z$-transform is $F(z)=H(z)/G(z)$, then C is also unstable?

False:

\begin{align}
H(z)&= \frac{1}{1-2z^{-1}}: \textrm{ROC} \quad\lvert z\rvert>2\\
G(z)&= \frac{1}{1-3z^{-1}}: \textrm{ROC} \quad \lvert z\rvert>3\\
F(z)&= \frac{1-3z^{-1}}{1-2z^{-1}}: \textrm{ROC} \quad \lvert z\rvert<2
\end{align}

It is the answer, but doesn't $F(z)$ ROC must be like that of $H(z$), or the division allows to choose the ROC I want?


texts: Periodicity and fundamental frequency detection algorithms

texts:
I have some time series datasets which are periodic, and I'd like to pick out the fundamental frequency of the data and take the average over a fundamental period.

Questions:

1) Would something simple like taking the FFT of the time series data and looking for the strongest peak frequency do the trick, or are there more complicated period detection algorithms out there? For what it's worth, I'm trying to do all this in MATLAB.

2) There are some edge effects, particularly at the beginning of each data set. Would I have to take this into account?


texts: Why does shortening window widen its Fourier Transform?

texts:
On page 76 of the book Discrete Time Speech Signal Processing by Thomas F.Quatieri, the author states "shortening the window widens its Fourier Transform".

Can anyone explain why?


texts: How do you change an instance of dsp.DigitalDownConverter object in MATLAB to work with filters other than the ones it is originally defined with?

texts:
If you look at this website:

https://www.mathworks.com/help/dsp/ref/dsp.digitaldownconverter-system-object.html

you will see an example (with code) that attempts to up convert and down convert a sine wave.  So at the bottom of the tutorial you will see 3 plots.  The first shows the frequency spectrum of the sine wave, which has a frequency of 1 kHz. The second plot shows the frequency spectrum of the up converted sine wave, with a frequency of 50 kHz.  The third plot shows a frequency spectrum of the down converted sine wave, which has the exact same frequency of the original sine wave( 1 kHz).  So up and down converting appears to be working happily.

My question is, in the 4th plot, they show 3 different filters (or filter stages) within the ddc object (I believe the cic decimator, cic compensator, and halfband decimator).  How can the ddc object be modified to use different filters? What if I want to use a low pass filter? Or a high pass filter? Or a butterworth filter? Am I not able to change this?


texts: How can I calculate homography from the room height and camera calibration matrix?

texts:
EDIT2: I've added an assumption that the camera calibration matrix is given. Other factors (rotation, camera pose) are still not given.

I want to measure actual lengths of floor edges (blue lines in the example below) of a room by finding the homography matrix, from its length given in pixels (of blue lines in the second image).

We can use the camera calibration matrix, the height of the room (green lines in the example below), the room layout image (like the second image) and the assumption that the room follows Manhattan layout.

Example:

EDIT: I've removed some words that makes the question looks begging for an working code. Anyway, thank you for your answers. I've decided to take photos from our camera with drawing several lines parallel with the wall to do this.


texts: Applying discrete Wigner-Ville distribution to Lena picture?

texts:
It seems that 2D Wigner-Ville has been used to test the compression of data.
The interference is however a problem.

Can someone send me a link to a code where this has been done?
I want to study the code and change it little study the compression and Wigner distribution.

Here, seems to be basic steps to make 512x512 matrix out of the picture.

So it is now only the application of the distribution to the image.
Then, JPEG2000 compression of the resulted image to test.
And make a plot PSNR(dB) as a function of Coding Rate (bits per pixel).

Where and how can you apply Wigner-Ville to the image?

I need to apply the function and Fourier transformation to every single pixel of the picture, here.

I have the Lena picture in 512x512 in Matlab, done by

lena512 = imread('lena512.bmp');
lena512 = double(lena512);

I am reading the package here and thinking where Wigner has been possibly been applied.
Not sure if used at all.
However, it speaks there something about autocorrelation so it can be possibly applied in code:

  The long-range correlations in the original series are eliminated by
  the wavelet transform, and that the wavelet coefficients form series
  with virtually no autocorrelation or cross-correlation.

Where Wigner Distribution has been applied to the Lena picture?


texts: Difference Between Correlation and Convolution in the Context of Image Processing

texts:
Could you please clearly explain what is the difference between correlation and convolution that is done by a filter on an image?

I mean in terms of signal processing definition I know that convolution describes the output of an LTI system, that is if an LTI system produces an output due to convolution with an input system then the output signal can be described as the result of convolution of the input signal and the impulse response of the LTI system. As for the correlation, it describes the similarities between to signals. But how does convolution and correlation effect on a image and how different are they in terms of effects?

Thanks


texts: How can I run this MATLAB code snippet for the waveform synthesis?

texts:
Can you give me an example for this MATLAB snippet to generate sine wav with specified phase?

function synthesize_fp(file,f,d,p,gamma)
% Matlab function synthesize_fp(file,f,d,p,gamma)
% creates a .wav audio file of a sound where all frequencies,
% amplitudes(power) and phase may be specified.
%
% file is a string which is the name of the .wav file.
% f is a length n vector of frequencies in Hz
% d is the duration in seconds
% p is a length n vector of amplitudes
% gamma is a length n vector of phase shifts, as a fraction of the
%  period of the first harmonic f1.
%
% Mark R. Petersen, U. of Colorado Boulder Applied Math Dept, Feb 2004

Fs=22050; nbits=8;              % frequency and bit rate of wav file

t = linspace(1/Fs, d, d*Fs);    % time
y = zeros(1,Fs*d);              % initialize sound data
for j=1:length(p);
  y = y + p(j)*cos(2*pi*f(j)*(t-gamma(j)/f(1))); % sythesize waveform
end
y = .5*y/max(y);                % normalize.  Coefficent controls volume.
wavwrite( y, Fs, nbits, file)


texts: Does the system matrix being singular tell us anything about the system?

texts: If we have a linear system, represented in State Space and the A matrix is singular (det(A) == 0), can we expect any special properties from the system?


texts:
My question here is in regards to implicit information/terminology.

Basically, whenever we say that "a shift in time means a change of phase in fourier space", is it implicit that the shift is always circular? Are there any exceptions to this? Caveats? etc?


texts:
I don't understand what is a first order sequence. For more context: I am reading a paper where the author extracts different sequences (in the STFT domain) and then "The resulting sequences are differentiated (via first-order difference)".

What is the meaning of first order difference here?


texts: with given Sampling rate, what max frequency human voice can be captured?

texts:
I'm new to signal processing and sampling rate, I was asked interview question related to this.

This is the exact question asked:

With 8Khz of sampling rate, whats the max frequency that human voice can be captured ?

  Options provided:

a) 4Khz

b) 8Khz

c) 16Khz

d) 32Khz

I have checked few Q/A websites but couldn't find anything helpful. I did find something similar in this SP stack --> link

And I've also found that for human voice range are upto 8Khz for male and 17 Khz for female. I don't know if it's helpful but I thought I should add this in the question.

Any help, would be really appreciated thank you :)


texts: Music/Speech Classification: How are frame based features used in a feature vector?

texts:
I'm a little confused on how frame based high dimensional features such as mfcc's and bfcc's are applied in the classification of musical instruments.

Are statistical measures of the features used e.g. using the standard deviation across the frames used as a feature? Or is each frame of coefficients used as independent features e.g. 2 frames, 13 coefficients --> 26 features? a combination of both or something completely different?

Thanks


texts: When input data into a low pass filter, are the first several data unusable?

texts:
For example, I want to feed a DC into a low pass filter. The the filter's first several output will not have the same DC value I want.

Does it mean that I need to dispose first several results?
How many shall I dispose?
What is the technical term describing this phenomenon, step response?
Does it only happen to DC or to other frequency signals as well?

Here comes sample code and diagram:

Fs = 64e3;
f = 8e3;
T = 1/Fs;
t = 0:T:0.002;
input = 0.002*cos(2*pi*f*t);
input_with_DC = input+0.5;

[b,a]=cheby1(1,2,0.4);
output = filter(b,a,input_with_DC);

plot(input_with_DC)
hold
plot(output,'r')

It can be seen from above diagram that the DC rises at first and then approach to the actual DC value.


texts:
I'm analyzing speech signal for identifying voiced and unvoiced regions. Voiced regions are supposed to have a "pitch", which can be estimated using auto-correlation function (ACF). Basically, one estimates ACF for each frame of speech (say 20ms) and then finds the time lag between peaks in ACF output. If all the significant peaks in ACF output are equidistant, I can say that the signal is very much periodic. If the peaks have random spacing between the, that would indicate aperiodicity.

Based on this, what measure can I use to find out HOW MUCH periodic a signal is? If I denote time lag between successive peaks as lag1,lag2...lagN; the deviation from mean of these values can tell how much periodic the signal is. Any better ideas?


texts: Impulse response function from pole-zero graph

texts:
I know that that the poles of this system are: $s_1 = -1 + 2j$ and $s_2 = -1 - 2j$. I think to solve this problem I would need to find the laplace of this plot, with the formula:
$$
W(s) = \frac{\rm zeros}{\rm poles}
$$
Then I would need to get the inverse Laplace. I am stuck on how to get the zero when it is not provided in the plot.


texts: What channel model to choose while simulating a system in passband with frequencies over GHz range?

texts:
I was wondering as to what kind of channel model do we use to test for BER vs SNR in a passband RF system. The system that I designed is basically a wideband frequency hopped OFDM system where I use Digital up-converter (DUC) to up convert the signal to a frequency in GHz range and use the Digital down converter (DDC) to down convert the signal back to baseband in the receiver side. Now my system works fine. However, when I add an AWGN channel, I get pretty low BER of 10^-5 in passband as compared to around 10^-4 BER in baseband under same AWGN channel of SNR 10 dB. Why is it happening? I thought that there would be more attenuation in passband as attenuation increases with respect to frequency. Or is it that my way of modelling the channel isn't good. Btw, I have tried adding Rayleigh SISO fading channel along with AWGN but in that case I achieve around 0.4 BER which is quite high. I just don't know anything about BER vs SNR plots in passband. All the plots that I found are mostly in baseband.

So my question is

How do I model the channel in passband?
How does a typical BER vs SNR look like in passband?

Thank you!


texts: Approximating the frequency response of a median filter

texts:
A median filter is a non-linear and lossy process, so it doesn't have a closed form frequency response as would a FIR filter (say a box filter of the same length) in an LTI system.

But how closely can something similar to a frequency response of a median filter be approximated?
How would this scale with the length of a median filter?
Under what conditions or for what class of signals might this approximation be ballpark "close"?
For what class of signals might this approximation be very inaccurate?
What kinds of frequency domain distortion or additive noise does a median filter produce?


texts: Increase SNR by using only the first 200 samples

texts:
I am making an experiment using sound source and microphones. I use metronome as the sound source, so I can consider it as impulse sound. I placed the microphones at different places about 1 meter above the floor. I use a recording system to get a sound file from each microphone. However I noticed that the acquired sound waveform from each microphone is different. For example let's say that one impulse sound is about 300K samples (48K sampling rate). The waveform of sound in microphone 1 and microphone 2 is similar only about the first 500 samples, mic 1 and mic 3 is similar only about the first 200 samples and so on. My guess that it is caused by the reverberation from the environment. Using Matlab function to find the delay is only good when I use only the first 200 samples.
Question:

Can I consider this as low SNR?
Can I use only the first 200 samples for each impulse sound as to improve the SNR?

Thank you.


texts: Maximum cross-correlation coefficient value for time delay estimation

texts:
I am using cross-correlation for time delay estimation of two synchronized recordings ($x_1$ and $x_2$) of a fixed sound source from two different locations.

I understand that the delay is associated with the maximum cross-correlation coefficient.

My question: should I use the maximum of the cross-correlation coefficient vector or absolute cross-correlation coefficient vector?

This

$\Delta t \approx \tau_{peak} =  \underset{\tau}{\arg\max} (\rho_{x_1 x_2}(\tau))$

or this

$\Delta t \approx \tau_{peak} =  \underset{\tau}{\arg\max} (|\rho_{x_1 x_2}(\tau)|)$


texts:
Over the past few weeks, I have been working on a problem of segmenting an audio file containing some bat samples. I have now successfully come up with a moderate algorithm to do this.

I am trying to calculate the herts, or, the Htz of each of blocks that I have deemed to contain interest.

Currently, for the signal I am calculating the frequency using the following:

$$ freq = i * Fs / NFFT $$

Where i is the bin_index of the currently block.

This produces a vector containing 128 values which holds the frequencies. This, looks correct when I am plotting the spectrogram.

For each of the blocks that are of significance, I calculate the following:

1) Take the max magnitude of each of the blocks, capture the index
2) Match the index (calculated above) against the frequency vector

This, for one of the blocks produces the following:

hertz = 3375

To which I convert to Htz using the following:

Htz = hertz / 1000 = 3.375

Now, from my estimation, 33.3Htz does seem reasonable since this is in audible hearing, however, why am I getting such a small number, compared to what I should be getting?

Thanks


texts: Finding Peaks in an Autocorrelation Function

texts:
I'm trying to find the period of a signal. I've used FFT to compute the autocorrelation of the signal. As can be seen from the autocorrelation function (plotted below) I obtained, there are 70 sample between peaks which actually indicates the period of my signal.

What is the best way to extract the indices of these peaks from such a data?


texts:
I have a signal in time domain, and I have to convert it into frequency domain and divide it into 100 channels, and find the center frequency of each channel.

I am not good in "MATLAB" so how to do that, help will be appreciated.


texts: Parameter estimation of mixture of damped sinusoids

texts:
What are the most known methods (algorithms) for the parameter estimation of the superimposed (mixture) of damped (complex) sinusoids?

The noiseless signal model (with $P$ sinusoids) is as follows:

$$x(t) = \sum_{i=1}^P  A_i e^{s_it}$$

$A_i=a_i e^{j\phi_i}$ is a complex amplitude.
$s_i=\alpha_i + j \omega_i$, where $\alpha_i <0$: damping factor and $\omega_i$: angular frequency.

The most known methods I know are used for such parameter estimation are Pisarenko, Prony, Matrix Pencil, ESPRIT, MUSIC. Nonetheless, I'm not sure if all can be used for this model or if some are only used for particular cases (for e.g. undamped sinusoids) or if there are any specific cases or conditions where we can use one but not the other.

Are there any good references summarizing the different estimation algorithms for this model, and giving the main differences, advantages and disadvantages?


texts: Finding circle in binary image (R, not matlab)

texts:
How would I extract the circular area of a binary image which looks like:

The two rods emerging from the side of the circle are noise.
I know of the hough transform in Matlab. However, I am using R and can't seem to find anything similar.
Ideas anyone?


texts: What is the Z-transform of $0.8^{n+2}u(n-1)$?

texts: I have 2 signals. One is $x(n)=(-0.5)^nu(n)$ and the other one is $y(n)=0.8^{n+2}u(n-1)$. I know that for the first one it is $X(z)= 1/(1+0.5z^{-1})$, but what about the other one? I know $y(n)$ is time shifted but i don't know how to find this z-transform. Any help would be appreciated!


texts: how the 4G LTE Or 5G NR OFDM measures and corrects the sampling frequency offset? if there is an algorithm using matlab please help


texts:
Here is my target, given a set of consecutive discrete 1-d data points within a window. I want to know whether there are good algorithms to detect certain typical shapes of the signal in the window. Including:

A positive step
A negative step
An upward line
A downward line
A hill shape
A bowl shape

The size of the given window could be of any length. And the data is from financial markets so it could be highly random. I wonder if there are good methods to detect whether the above typical shapes exist in the window, which could of course be given by a probability for each shape. I don't need very concrete descriptions of each algorithm, just need to get a direction for my further research.


texts: Implementation of Overlap Save Filtering with Decimation

texts:
I am trying to implement Matlab code which performs FIR filtering with complex bandpass filter using Overlap Save method and perform decimation as well by using different length forward and inverse FFT as mentioned in this article:
https://www.iro.umontreal.ca/~mignotte/IFT3205/Documents/TipsAndTricks/MultibandFilterbank.pdf
Below is the code snip I have written:
clear all;close all;clc
fs=1e6;
sim_time=20e-3;
Nfft=256;

t=0:1/fs:sim_time-1/fs;
freq = fs/Nfft*(0:Nfft-1);

%create composite signal
fsig1= 50e3;
fsig2= 100e3;
fsig3= 300e3;
fsig4= 872e3;

sig1=2*cos(2*pi*(fsig1-5e3)*t)+4*cos(2*pi*fsig1*t)+8*cos(2*pi*(fsig1+5e3)*t) + j*(2*sin(2*pi*(fsig1-5e3)*t)+4*sin(2*pi*fsig1*t)+8*sin(2*pi*(fsig1+5e3)*t));
sig2=8*cos(2*pi*(fsig2-5e3)*t)+4*cos(2*pi*fsig2*t)+2*cos(2*pi*(fsig2+5e3)*t) + j*(8*sin(2*pi*(fsig2-5e3)*t)+4*sin(2*pi*fsig2*t)+2*sin(2*pi*(fsig2+5e3)*t));
sig3=2*cos(2*pi*(fsig3-5e3)*t)+8*cos(2*pi*fsig3*t)+4*cos(2*pi*(fsig3+5e3)*t) + j*(2*sin(2*pi*(fsig3-5e3)*t)+8*sin(2*pi*fsig3*t)+4*sin(2*pi*(fsig3+5e3)*t));
sig4=10*cos(2*pi*fsig4*t)+j*10*sin(2*pi*fsig4*t);

sig=sig1+sig2+sig3+sig4;

% Create Filter
bpFilt1 = designfilt('lowpassfir', 'FilterOrder', 40, ...
             'PassbandFrequency', 100e3, 'StopbandFrequency', 150e3,...
             'SampleRate', fs);

%filter impulse response
h1= bpFilt1.Coefficients;
%create complex band pass by multiplying with complex exponential
fc=800e3;
cmp_exp=exp(j*2*pi*fc*t);
h1_c=h1.*cmp_exp(1:length(h1));
%take FFT of filter impulse response
H1=fft(h1,Nfft)/Nfft;% low pass prototype
H1c=fft(h1_c,Nfft)/Nfft; %complex bandpass filter

%implement overlap save
P=41;%filter length

for i=1:10 % This code snippet compute the OSA filter with decimation by 4
    if(i==1)
        sig_win=sig(1:Nfft);
        index_fft_in=Nfft;
    else
        %sig_win=sig((i-1)*256-(P-1):(i-1)*256-(P-1)+Nfft-1); %overlapped input
        sig_win=sig(index_fft_in-(P-1):index_fft_in-(P-1)+Nfft-1); %overlapped input
        index_fft_in=index_fft_in-(P-1)+Nfft-1;
    end

    X_sig=fft(sig_win,Nfft)/Nfft;

    Y_sig=H1c.*X_sig;%multiply with complex bandpass filter
    y_sigd(i,:)=ifft(Y_sig((3*Nfft/4)+1:4*Nfft/4),Nfft/4)*(Nfft/2)^2;%extract complete for now to test filtering

    if(i==1)
        y_osa=y_sigd(i,((P-1)/4)+1:end);%discard the first (P-1) points
        index=length(y_osa);
    else
        y_osa(index:index+(Nfft/4)-(P-1)/4-1)=y_sigd(i,(P-1)/4+1:end);
        index=length(y_osa);
    end

end

% figure;plot(freq/1e3,abs(H1),'-*r')
% hold on;plot(freq/1e3,abs(H1c),'-ob')%plot filter responses

y1 = filter(h1_c,1,sig(1:10*Nfft)); % apply filter 1 %reference for comparison

%compare decimation in FD vs TD
y1_d = downsample(y1,4);

figure;
plot(real(y_osa),'-ob')
hold on;plot(real(y1_d),'-*g')

I am also doing the same filtering in time domain along-with downsampling to ensure that the time domain and frequency domain implementations are equivalent however there is some glitch in the output when compared as shown in image below:

Can anyone point out the mistake in the code or the method and suggest solution?
Edit: The first block of the result appears to match the reference time-domain filtered signal but some issue occurs in the subsequent blocks.
**Also, the result is fine when the same length of IFFT is performed (without any decimation) and the result matches exactly that of the time-domain reference signal. The issue is only when smaller IFFT size is used for required bins.


texts: Can I segment characters from this image with CSV?

texts:
I am trying to segment my characters on this image with using column sum vector.

This method actually works on the paper I've read about license plate recognition.

it looks useful for my images too but since my threshold values are not very good I am not really sure if I can use CSV for character segmentation

so my question is;

1) Is CSV proper method for my application ?
2) if so what kind of techniques I can try to segment characters ?
3) if not what can be more efficient and robust way to segment characters from some kind of images ?

thank you


texts: Meaning of Multiplying a complex number with its conjugate

texts:
While reading Estimation of Symbol Timing Offset, i came across an equation like multiplying a signal with its conjugate.

$$
\hat{\delta} = \arg \max_{\delta} \sum_{i=\delta}^{N_g-1+\delta} \left|y^*(n+i) y(n+N+i)\right|^2
$$
I know multiplying

(5+4i) X (5-4i) = 25 - 20i + 20i + 16 = 25 + 16 = 41.

But am not getting the meaning of this 41. What it represents ???


texts:
I have this system:

$$ y[n] = -\frac{1}{2}  x[n+2] - y[n+1] $$

I have no idea how to prove if the system is linear or not, because, it depends on future outputs...

Thanks for the help


texts:
I am recording a 30 second 1000Hz Sine wave, saving it to a list, splitting the list into 5 second sublists and I would like to apply a notch filter to each sublist to check when the signal drops out for a few samples (I'm filtering out the 1000Hz frequencies). I am using python along with scipy for signal processing. I had some success using this method when I recorded the signal and applied a filter to the entire signal at once, but whenever I try to apply a filter consecutively to 5 second chunks of the signal, I seem to detect glitches that aren't there.
Here is the code for my filter.

   f0 = 1000.0  # Frequency to be removed from signal (Hz)
    Q = 30.0  # Quality factor
    w0 = f0/(fs/2.0)  # Normalized Frequency
    # Design notch filter
    b, a = signal.iirnotch(w0, Q)
    sos = signal.tf2sos(b,a)
    zi = signal.sosfilt_zi(sos)*lists[0][0]
    for list in lists: #each list is 5 seconds long
        Time=np.linspace(0, len(list)/fs, num=len(list))
        plot_graph(Time,list,fs)
        y_sos, zi = signal.sosfilt(sos, list, zi=zi*list[0])
        plot_graph(Time,y_sos,fs)

The graph below shows the first filtered 5 second chunk.

The large peak just after one second is a genuine dropout but the 3 smaller peaks should not occur at all.

The graph below shows the next filtered 5 second chunk

There are no glitches at all in this section, yet the small peaks still occur. I would also ideally like to get rid of the peak that begins at 0 and 5 seconds of each chunk.
Can anyone tell me what is wrong with my filter/method?

Edit:

Changed my code to the following:

    f0 = 1000.0  # Frequency to be removed from signal (Hz)
    Q = 30.0  # Quality factor
    w0 = f0/(fs/2.0)  # Normalized Frequency
    # Design notch filter
    b, a = signal.iirnotch(w0, Q)
    zi = signal.lfilter_zi(b,a)*lists[0][0]
    for list in lists: #each list is 5 seconds long
        Time=np.linspace(0, len(list)/fs, num=len(list))
        plot_graph(Time,list,fs)
        y, zi = signal.lfilter(b, a, list, zi=zi)
        plot_graph(Time,y,fs)

I'm still obtaining the same problem of strange peaks occuring where they shouldn't although it seems to remove the peak that occurs at the beginning and the end of each chunk. The following graph shows the first filtered 5 seconds, the big peak after 1 second being a genuine dropout, the smaller ones are not sropouts.

The following graph shows the next filtered 5 seconds where there are no dropouts and these peaks should not be occuring at all.

Edit 2:
Zoomed in miniature peak


texts: What is the Fourier Transform of $\DeclareMathOperator{\rect}{rect} \rect(2Bt)\cos[{\omega}_Ct + k_fm(t_k)t] $?

texts:
What is the Fourier Transform of $\rect(2Bt)\cos[{\omega}_Ct + k_fm(t_k)t] $?

I got the following as the solution:

$$\DeclareMathOperator{\sinc}{sinc} \frac{1}{2} \frac{1}{2B} \sinc(\frac{\omega+{\omega}_C+k_fm(t_k) +}{4B}) + \frac{1}{2} \frac{1}{2B} \sinc(\frac{\omega-{\omega}_C-k_fm(t_k) +}{4B})$$

However, in the book it is given as:

$$ \frac{1}{2} \sinc(\frac{\omega+{\omega}_C+k_fm(t_k) +}{4B}) + \frac{1}{2}  \sinc(\frac{\omega-{\omega}_C-k_fm(t_k) +}{4B})$$

Wolfram alpha shows this:

https://www.wolframalpha.com/input/?i=Fourier+transform+calculator&assumption=%7B%22F%22%2C+%22FourierTransformCalculator%22%2C+%22transformfunction%22%7D+-%3E%22+rect%282Bt%29cos%28pt%29%22&assumption=%7B%22F%22%2C+%22FourierTransformCalculator%22%2C+%22variable1%22%7D+-%3E%22t%22&assumption=%7B%22F%22%2C+%22FourierTransformCalculator%22%2C+%22variable2%22%7D+-%3E%22w%22


texts: Causal and non-causal systems in real world

texts:
Causal systems are defined as the systems whose :

Output depends on present as well as past inputs and the impulse response; and sometimes depends also on the past outputs (in case of recursive systems).
Impulse response $h(n)$ consists of only positive samples.

Also, I am trying to link this concept to real world scenario using FIR filter whose design equation is:$$y(n)=h(0)x(n)+h(1)x(n-1)+\ldots+h(M)x(n-M)$$

Based on all this theory, I have questions as given below :

a. I wish to ask if it is possible for any system (non-causal/anti-causal real world system) to have negative samples?? Is it that be it causal or non-causal, all real world systems always have positive samples only? Negative samples are of consideration only in theory?
b. We show past inputs using delay blocks $\left(z^{-1}\right)$. So, this means delayed signals give us past inputs in real world? I am confused. I thought the filter uses past inputs saved in its memory. How can we get past inputs by adding a delay?
c. If I take any real world filter, and suppose I give an input sine wave of some frequency to it. Then, filter decides if this frequency should be allowed to pass or not depending on the past input samples of this sine wave which it had stored in its memory? So, this way the output depends on past inputs as well and so we say it is causal system?


texts: Physical interpretation of 4th-order correlations

texts:
BACKGROUND:

Let's say we have samples of a random process $X(t)$ at two different times, $t_1$ and $t_2$, denoted $X(t_1), X(t_2)$.  The values of $X(t)$ represent some voltage-like quantity (i.e. a voltage, current, or field). Assume $X(t)$ is a zero-mean, real-valued wide-sense stationary (WSS) process.

For the second-order statistics,  we usually treat the quantity $\mathbb E[X^2(t)]$ as the average power.
The expectation $\mathbb E[X(t_1) X(t_2)]$ is just the autocorrelation function evaluated at lag $\tau = t_2-t_1$.

QUESTION:

Is there some physical interpretation of the 4th-order correlations, i.e. $\mathbb E[X^3 (t_1)X(t_2)]$, $\mathbb E[X^2 (t_1)X^2(t_2)]$, and $\mathbb E[X (t_1) X^3(t_2)]$?


texts: Compressing plotted data with variable sample rate?

texts:
I'm currently plotting high sample rate data by down-sampling by a factor and averaging. Most of the time this is working ok, but I am aware that at very low zoom levels (zoomed right out) the averaging is hiding vast amounts of data.

I have a timestamp for every data point, so are there any algorithms out there which will remove the pointless and 'less useful' points? I've done a bit of Googling and found papers retlated to time-series data compression, but that's not really what I'm after. I'm looking for something which will take advantage of the particular properties of plotting. ie. if you have 10 consecutive points with the same value, the intermediate ones can effectively be removed without losing any detail in the visual representation.


texts: How to implement one dimensional low pass Gaussian filter with zero-phase shift?

texts:
I am trying to apply a low pass Gaussian filter on a signal and find the exact location of maximum/minimum in the resulting smoothed signal. I have to do it for a few values of sigma (Gaussian bandwidth).

How is it possible to implement such Gaussian filtering and compensate phase shifts during filtering so that I can find the exact location of extrema as an index of signal location?

Appendix:

I have tried:

1) Convolution with a low pass Gaussian kernel (windowing) results in extension of resulting signal length which makes it impossible to find extremum as an index of original signal.

2) use of Fourier transform on signal and kernel and multiplication in Fourier domain makes the resulting signal in time domain circulary shifted.


texts: What Is the Derivative of the Function $ s \left( t \right) = \left( 1 - {e}^{\frac{-t}{RC}} \right) u \left( t \right) $?

texts:
What is the derivative of the following function

  $$ s \left( t \right) =  \left( 1 - {e}^{\frac{-t}{RC}} \right) u \left( t \right) $$

  with respect to $t$, where $u(t)$ is a unit step function?

I am getting $ \delta(t)+\frac{1}{RC}e^{-t/RC}u(t) $ as the answer. Is my answer correct?


texts: What is 'antenna-chain permutation' and its advantages?

texts:
I am working with Wi-Fi channel state information (CSI, a sort of channel matrix with OFDM subcarriers). I am using Intel 5300 Wi-Fi card and this tool provides a way to play around with extracted CSI information via MATLAB.

Interesting thing is, there is perm, a permutation vector in a figure below:

It says a permutation vector is [2, 1, 3]. In FAQ page of the tool, it says:

  perm tells us how the NIC permuted the signals from the 3 receive antennas into the 3 RF chains that process the measurements. The sample value of [3 2 1] implies that Antenna C was sent to RF Chain A, Antenna B to Chain B, and Antenna A to Chain C. This operation is performed by an antenna selection module in the NIC and generally corresponds to ordering the antennas in decreasing order of RSSI.

What I am curious about is, why does this Intel 5300 Wi-Fi card do antenna-chain permutation and what are advantages of performing it?


texts: why does/ doesn't phase count when you analyze a voice signal?

texts: I am new to digital signal processing, I want to know why phase should not affect the analysis of a voice signal.


texts: Counting shape changing pattern in signal

texts:
I need to count the number of 'patterns per second' in a signal. The problem is that the signal changes 'shape' a lot and unpredictably. It is still easy for a person to see the the pattern, but I don't know how to do this with code.

EDIT For extra clarity: say the first sample is 1 second. There are 17 copies of the pattern in this sample. So I want to compute "17 (patterns per second)".
Also, it might be worth noting the samples below are from a continuous measurement, in this order.

Any ideas how to tackle this?

(It needs to count the pattern in realtime.)

Here are some samples of the signal. (Zoom level in both directions is identical for all images.)


texts: Difference between librosa.stft and scipy.signal.stft

texts:
I read the source code of librosa.stft and sicpy.signal.stft, and notice that the calculation results of STFT(short-time fourier transform) in these two libraries are quite different:
In scipy.signal.stft, the stft result is scaled by 1.0/win.sum(), while in librosa.stft no scaling or normalization procedure is done. So why scipy.signal.stft do the additional scaling procedure? And is there any other difference in the calculation of STFT in these two libraries?


texts: Difference between Fourier transform of $\left(\frac{1}{3}\right)^{-k}$ with $k\le -1$ and $\left(\frac{1}{3}\right)^{k}$ with $k\ge 1$

texts:
When I want to calculate the discrete Fourier transform of $\frac{1}{3}^{-k}$ with $k\le-1$ I get that:
$$
\sum_{k=-{\infty}}^{-1}\left(\frac{1}{3}\right)^{-k}e^{-j\omega k} = \sum_{k'=1}^{\infty} \left(\frac{1}{3}e^{j\omega}\right)^{k'} = \frac{\frac{1}{3}e^{j\omega}}{1-\frac{1}{3}e^{j\omega}}
$$
But if I change the variable before finding the Fourier transform I have the function $\left(\frac{1}{3}\right)^k$ with $k\ge1$ (both functions are the same). The discrete Fourier transform of the new function is as follows:
$$
\sum_{k=1}^{\infty}\left(\frac{1}{3}\right)^{k}e^{-j\omega k} = \sum_{k=1}^{\infty}\left(\frac{1}{3}e^{-j\omega}\right)^{k} = \frac{\frac{1}{3}e^{-j\omega}}{1-\frac{1}{3}e^{-j\omega}}
$$
Are these two the same?


texts: How to programmatically find a sharp change in slope

texts:
First, apologies if I have the wrong group or this question is far too easy for this group.  I am (as you'll see) a newbie. Please point me to another, more appropriate group OR tell me how to fix the question to be more appropriate for this group.

I have some data that represents a thermometer that is put in a fridge, and then a freezer, and then finally, back out of the freezer to the fridge.  The data might look like this:

The horizontal axis is time in seconds and the vertical axis is Celsius. As you can see, it's quite obvious where the thermometer goes into the freezer and where it comes out.  One can with the naked eye come up with a pretty good  estimate as to where this happens.  I'd like to be able to have a computer program (C#) figure this out for me for other data sets that all have this general form.  One way  might be to look for when the data first reaches -10 and argue that the transition happened at about this time.  Another might be to look for a change in the 2nd derivative.  That's about the extent of my knowledge.  I can imagine there is a whole literature devoted to this problem and probably libraries of code that already do this. I'm looking for

1) Starter ideas on what to read to educate myself about this problem.

2) Example code in C# (or JAVA or C++) that does the automatic detection.

I would like to be able to feed a time series into an algorithm, and have an estimate of when the thermometer was put in the freezer (or taken out) WITH some sort of confidence interval. Example: "it went into the freezer at 18420 seconds +/- 100 seconds with 95% confidence".  I am willing to assume (for now) that the thermometer starts changing temperature as soon as it is moved from the fridge to the freezer (I'm still researching this!).

Those are the questions.  For those, who are curious for background information, please continue to read.  I'll add that the motivation is that we are trying to see if some thermometers in the fridge and freezer are in spec.  We have several thermometers in the fridge and freezer that we would like to know are in spec.  We have a highly accurate "reference" thermometer that we can move around with a robot to the locations where the fridge/freezer thermometers are.  As we move the reference thermometer to the various locations with the robot, we have the relevant fridge or freezer thermometer take a temperature and record it.  This we can do with very accurate timing.  The problem is that the reference thermometer just has a counter every 10 seconds.  Presumably the measurements are really 10 seconds apart but there is not absolute time measurements.  It's just a counter from 0.  You can see the graph of the reference thermometer in my attached picture.  It occurs to me that since I move the reference thermometer to the first freezer station, I should be able to use that point on the graph as a "pin" to connect the two timelines.  I'd further point out that I leave the reference thermometer at each station for several minutes, so there is some slop available.  Finally, for those wise folks that say, "why not have the reference thermometer communicate with the rest of the system via Bluetooth or similar so you don't have to try and match things up after the fact?", my reply is "already suggested (several times) to management without success" :)


texts:
In one of the homeworks that I am dealing with for Linear Systems course, I have encountered with such a statement: Consider $\mathbb{C}^N$ the vector space of N dimensional complex vectors. We can define a basis
$F=\{f_1,\ldots,f_N\}$ where
\begin{align}
f_k = \begin{bmatrix}
    f_{k,1}       \\
    f_{k,2}        \\
    .\\
    .\\
    f_{k,N}
\end{bmatrix}
\end{align}

and $f_{k,l} = \frac{1}{N}e^{\frac{j2\pi(k-1)(l-1)}{N}}$. It is straightforward to show that those vectors are orthogonal, but I have no idea about how to show that those vectors are linearly independent, and their span is $\mathbb{C}^N$. Could you please give me a clue?


texts:
I have a process $X$ with frequency spectra

I sample this process with sampling frequency $f_s = 2$.

What will the frequency spectra $R_z(f)$ of the sampled process $Z$ look like? I realize that aliasing occurs since the original process contains frequencies above the Nyquist Frequency (in fact only contains frequencies above the Nyquist Frequency). The process has no frequencies within the interval where no aliasing occurs, i.e, $-1 \leq f \leq 1$. Therefore I reasoned that the frequency spectra of the sampled process would be $R_z(f) = 0, \quad 1\leq f\leq 1$ but the answer is $R_z(f) = 2, \quad 1\leq f\leq 1.$ Why?


texts: 'ADC' sort of conversion method to retain information

texts:
I have a program that reads 16 bit two's complement format data to plot/analyze graphs. I have a database text file with various decimals which represent real analogue data, ie. let's say they are voltage readings:

-0.002948
0.08594
0.01
0.00777

When I convert to the 16 bit form with the toolbox's inbuilt function, I have to manually choose the 'gain'. If I choose 1, all these small numbers will be rounded to the nearest integer, ie 0.

So then my question is, what is the protocol for choosing this gain/normalization? Do I multiply everything by the maximum absolute voltage range divided by the largest absolute number? I want to retain as much information/reduce round off errors as possible.

ie. Multiply all numbers by (2^16/2-1)/0.08594 in this specific example.

Thanks very much.


texts: How should I remove obvious anomalies from spectral data?

texts:
I'm working with raman spectra and it seems that our spectrometer produces some anomalies at very specific wave numbers and I'm looking to remove them from the dataset. Here's a picture of 27 spectra of the same substance and below it a picture of the variance at the individual wave numbers.

From looking at the variance graph it seems fairly obvious where the anomalies are (ca. at wave numbers 480, 800, 1500, 1650-1700 and 2150).

I ultimately want to use the data for machine learning. So far I've implemented an algorithm that looks where the variance exceeds a certain threshold and then removes outlier spectra at that point (it removes the entire spectrum) until the variance doesn't exceed the threshold at any point. The problem with this algorithm is that it removes around 60% of the spectra which is acceptable but not ideal.

I'm thinking about a different method where I delete the information at all the wave numbers where the variance exceeds a certain threshold (like cutting out a vertical strip from the first graph where the variance is too high). Since most of the anomalies are relatively "narrow" I think I would't lose much information.

I want to know if one of these methods is clearly better than the other and why. Also I would like to know if there are any common methods used for dealing with this kind of data.


texts: Frequency-domain deconvolution: "Direct" filtering vs "Wiener" filtering

texts:
Can someone help with clarifying the difference between two approaches
to frequency domain "deconvolution:
For the frequency domain problem:
We want to find a filter $F(\omega)$ which will convert some observed signal $B(\omega)$
into a desired signal $D(\omega)$, which is known
i.e. $D(\omega) = B(\omega)F(\omega)$

The intuitive / direct approach is to just calculate $F(\omega)=D(\omega)/B(\omega)$

Application of the least-squares criterion leads to $F(\omega)=R_{DB}(\omega)/R_{BB}(\omega)$ i.e. $D(\omega)B^*(\omega)/B(\omega)B^*(\omega)$

Q1:
If the direct division can be done successfully (i.e. no zeros in the denominator),
the two approaches seem to always give identical answers in practice.
Is that because the direct division is actually handled in code (e.g. Python) using the conjugates.
Q2:
Does the distinction between the two approaches only arise when the division
requires the addition of some stabilizing noise in the denominator?


texts: Output of a discrete-time LTI system different form than input?

texts:
This question is related to this one. I'm going through old exams for a 2nd year systems and transforms course, and came across this question. I'm posting this question just in case my other question doesn't actually represent this issue properly...

The question states:

  Suppose that we are given the following information about an LTI system: if the input to the system is $x_1[n]=(1/6)^n u[n]$, then the output is $y_1[n]=[a(1/2)^n +10(1/3)^n]u[n]$. If $x_2[n]=(-1)^n$, then the output is $y_2[n]=(7/4)(-1)^n$ where $a$ is a real number. Determine the transfer function of this system and the value of the number $a$.

The solution proceeds by determining the z-transform of $x_1$ and $y_1$ and stating the transfer function as $H(z)=Y_1(z)/X_1(z)$.

However, it seems to me that it's impossible for this system to generate an output of $(1/2)^n+(1/3)^n$ if the input is $(1/6)^n$,and hence the question is somewhat contrived if not outright bogus - see the discussion pertaining to my other question.

What am I missing here?


texts: how to do smoothing a linear noise adc signal to a exponencial curve to increase and logarithmic to decrease

texts:
I am studying methods of signal smoothing obtained in an Analog Digital converter that is operated by a common potentiometer that generates a certain noise, such potentiometer is linear and I cannot change it to a logarithm.

The intention would be similar to converting a trapezoidal wave to a sine wave.

Below I present a graph with the curve I get today using a Single Exponential Smoothing

I even tried it with Double Exponencial Smoothing but I still haven't got the formula right when coding it.

#elif SMOOTHING_TYPE == SMOOTHING_SINGLE
  smoothing_low[index]  = (alfa_low  * value) + ((1 - alfa_low) * smoothing_low[index]);
  smoothing_high[index] = (alfa_high * value) + ((1 - alfa_high) * smoothing_high[index]);
#elif SMOOTHING_TYPE == SMOOTHING_DOUBLE
  uint16_t smoothing_low_old = smoothing_low[index];
  smoothing_low[index] = (alfa_low * value)
                  + ((1 - alfa_low) * (smoothing_low[index] - smoothing_y_low[index]));
  smoothing_y_low[index] = upsilon_low * (smoothing_low[index] - smoothing_low_old)
                  + ((1 - upsilon_low) * smoothing_y_low[index]);

  uint16_t smoothing_high_old = smoothing_high[index];
  smoothing_high[index] = (alfa_low * value)
                  + ((1 - alfa_low) * smoothing_high[index] - smoothing_y_low[index]);
  smoothing_y_high[index] = upsilon_high * (smoothing_high[index] - smoothing_high_old)
                  + ((1 - upsilon_high) * smoothing_y_high[index]);
#endif


texts: Phase measurement with FFT for DMM Keithley 7510

texts:
I am currenly working on a measurement driver for the DMM Keithley 7510. I implemented a harmonics measurement using FFT (from MathNet library).

First I simply sample my input voltage signal and apply the FFT.
From the complex values I get the amplitudes and the phases of the harmonics. The phase results are the phases relative to the fundamental.

I verified my implementations for the amplitude and phase measurement functions by feeding the functions with an "ideal" signal - a sine signal with harmonics generated in MATLAB.

The amplitude measurement works perfectly fine, but I have huge problems with the phase.

Firstly, with higher frequencies, the deviation of the phase increases. This is due to the input characteristics of the DMM, which is not the main problem. I did my measurements mainy at 50Hz.
Secondly, the phase depends on the number of samples. I did not analyze this too much, because I have a fixed sample rate for my measurement driver.
Now the main problem: there seems to be a correlation between the phase and the amplitudes of the harmonics (including the fundamental). This means that by changing the amplitude of a harmonic, the phase results change for all the harmonics. For instance an increase does not necessarily mean an increase in phase: for some harmonics, the phase increases while for others it decreases. I could not find any reasonable explanation for this behaviour.

I tried many different ways to solve the phase problem:

Windowing: I thought, that it might somehow help. Unfortunately, I found pretty much no sources on the effect of windows on the phase measurement.
Power of 2 for FFT: I have a power of 2 number of samples on which I apply the FFT.
DFT: I also tried to apply DFT and calculate the complex value at exactly the frequecies where I wanted. There is as good as no difference between FFT results and DFT results.
Amplitude interpolation: I found a paper where I found I formula for the amplitude interpolation. By finding the peak amplitude in the frequency domain, I calculated the corresponding phase, but no success.
Here I later found, that at the peak amplitude of a harmonic in the frequency domain, the corresponding phase is not the expected/ideal phase. This is also something, that I could not understand ...

My question now is whether I forgot any other things I should check for.
Are there any parameters that I should be careful about when computing the phase?

Any suggestions what I could do next?


texts: Why Coherence is not a valid metric when performing impact excitation?

texts:
INTRODUCTION
I have understood that Coherence is a function that explains the linear relationship between an excitation signal and a response signal. I know how it is calculated and why it is bounded between 0 and 1.
In a document by Bruel&Kjaer (page 38) I found the following:

The deterministic character of impact excitation limits the
use of the Coherence Function**. The Coherence Function will show a "perfect" value of 1 unless:

There is an antiresonance, where the signal-to-noise ratio
is rather poor. No particular attention needs to be
paid to this. Taking a number of averages should make
the FRF curve smooth (for noise at the output choose
H1).

The person conducting the test impacts the structure in
a scattered way, with respect to point and direction. This
should be minimized so that the Coherence is higher
than 0,95 at the resonances. If the impact point is close
to a node point the Coherence may be extremely low
(≈ 0,1). This is acceptable however, since the modal
strength at this point is weak, and not important for the
analysis.

My worry arose since I was getting a value of "1" for all the frequencies when analyzing the coherence for some impact testing evaluation.
QUESTION:
Why Coherence is not useful when evaluating the relationship between input and output, for experiments where impact excitation is used? Why do I always get a "perfect 1"?


texts: Is it possible to open 2 streams from the same microphone on Oboe?

texts:
I'm trying to open 2 input streams from the same microphone on Oboe but it's not working.
One of the audio inputs I'm opening is like this:
defaultBuilder().setDirection(oboe::Direction::Input)
        ->setFormat(oboe::AudioFormat::Float) // For now
        ->setChannelCount(1) // Mono in for effects processing
        ->openManagedStream(inStream);

then in the other:
builder.setChannelCount(channelCount)
            ->setDirection(isInput ? oboe::Direction::Input : oboe::Direction::Output)
            ->setSharingMode((oboe::SharingMode) oboe::SharingMode::Shared)
            ->setPerformanceMode((oboe::PerformanceMode) performanceMode)
            ->setInputPreset((oboe::InputPreset)inputPreset)
            ->setSessionId((oboe::SessionId) sessionId)
            ->setSampleRate(sampleRate)
            ->setFormat((oboe::AudioFormat) format)
            ->setChannelConversionAllowed(channelConversionAllowed)
            ->setFormatConversionAllowed(formatConversionAllowed)
            ->setSampleRateConversionQuality((oboe::SampleRateConversionQuality) rateConversionQuality)
            ;

Is it possible that because of the different properties of each open, things dont work? One of them is mono for processing some effects and the other is stereo for voice recording. The format may differ too, I don't know.
But in principle, I think it should be possible. Android should just split the microphone input into 2 and then act accordingly for each stream.


texts:
The Connes Window function is defined as :

w(f)=$(1-(\frac{f}{ \Delta f})^2)^2$     for $f<|\Delta f| $
w(f)=0         otherwise

The inverse fourier transform of this function can be analytically calculated to be a purely real valued function.
However performing IFFT using matlab gives me a complex function whith real and imaginary parts.
The code I used in the following:
delta_f=10;

fs=300;

nCyl = 5;

t=0:1/fs:nCyl*1/f;

x=(1-(t/delta_f).^2).^2;

plot(t,x);

NFFT=1024;

X=fftshift(ifft(x,NFFT));

fVals=fs*(-NFFT/2:NFFT/2-1)/NFFT;

plot(fVals,real(X),'b');

I think this discrepancy has something to do with the function being piecewise.
Is there something which I am missing?


texts: Gentle request for explanation on LPC and LPCC coefficients :)

texts:
If I understand what LPC does, I think. It predicts the next sample by taking into account previous $p$ samples. I don't understand why it is useful in DPS and speech recognition.

I also came across LPCC that can be derived from LPC and are related to sound frequency. I also find it hard to follow the idea why cepstrum coefficients are useful or even better for speech recognition.

I did read about MFCC, though. I understood that before DCT, the coefficients (no MFCC yet) are simply energies at particular frequency range of a signal that is filtered by a triangle band pass filter. I do not have a problem with MFCC apart from the last step when DCT is applied. I think it also has something to do with cepstrum.

Why do you think cepstrum is so useful for speech, speaker and music recognition?

I'd be grateful for some words on that :)

EDIT. I have found a typo. Instead of "I have a problem with MFCC apart from at the last step when DCT is applied" I really meant "I do not have a problem with MFCC apart from the last step when DCT is applied".

Could someone please add a tag "LPCC" to this topic? It is one of the techniques in speech I think and deserves to be tagged. I cannot do it at the moment. Cheers!


texts: wavelet packet transform and lifting scheme?

texts:
so the lifting scheme is basically an alternative to performing the discrete wavelet transform with several advantages.

But here are three questions which I did not find an answer to:

is it possible to use lifting also for calculation of the wavelet packet transform or does it just apply to the normal wavelet transform?
is the wavelet packet transform also critically sampled like the dwt or is it redundant?
if using a level basis in the packet transform, i.e. a representation which uses only elements from the same decomposition level, the time-frequency plot is regularly discretized. How does this representation then differ, if so, from a STFT which also exhibits constant Heisenberg boxes in the time-frequency plane.

Thank you for helping in advance


texts: Can software distinguish between different musical instruments

texts:
If possible, I would like to write a little script that can identify different musical instruments from just a recording.  Apart from variations of amplitude and frequency over time (which can be shown by time-dependant and spectrogram, respectively), what other variables are there?

Furthermore, how would one do the classification?  Fingerprinting is an option, but that would only work if a single piece at a time is played.


texts: How to take wavelet transform of sparse input data

texts:
I have a sparse dataset indexed by nanoseconds. Storing the dataset in a discrete fashion would take too much memory. I'd like to take a wavelet transform and I'd like it to be relatively fast. The dataset has about 100,000 dirac deltas in it.
Is this possible?
Thanks!
James


texts: System identification only using sine input?

texts:
Recently, I'm working on modeling a sensor's system model using system identification.

Subject to the experiment condition, I only have the sine input signal. In addition, the frequency can not continuous change. In other words, I only have some specific frequencies experiment data.

I'm new about system identification, but clearly this kind of signal can not let the system show all of the feature. So, is there any algorithm can get the system model only using sine input signal?

Thanks a lot.


texts: how to convert decay time to power law coefficiants

texts:
In audio, I am familiar with the definition of t-60, which is a characterization of a room impulse response (RIR) decay time. This characterization demands that the sound will have a 60 db decay over the specified time.
I am now trying to define a medium in a given tool that requires this decay to be evaluated using the power-law $\alpha = \alpha_0f^y$ and I have to define $\alpha_0$ and $y$.
How do I convert a specific decay time $t$ to the correct $\alpha_0$ and $y$, specifically in air and generally in another known medium?


texts: Simplification of a convolution-like expression

texts:
I am trying to further reduce the following expression (if there's a nicer way to write it):

$\sum_{k=-\infty}^{+\infty}\sum_{p=-\infty}^{+\infty} \sum_{l=-\infty}^{+\infty} w(k) \varphi_\mathrm{y}(l-p)\varphi_\mathrm{x}(k-n-l+p)$

where $\varphi_\mathrm{y}$ and $\varphi_\mathrm{x}$ are the autocorrelations of the signals $y(i)$ and $x(i)$, respectively.

I know I can express $\sum_{k=-\infty}^{+\infty} w(k) \varphi_\mathrm{x}(k-n-l+p)$ as a convolution (or a correlation, using the evenness of $\varphi_\mathrm{x}$) but I left the expression expanded in case it can help.

If necessary, I could take the simplified case of finite (M-samples-)length signals.

Regards


texts: Selecting the number of cycles for wavelet transform

texts:
I'm trying some wavelet analysis of EEG signals, using the phase lock measures
from [1], specifically the S-PLV measure.

In order to calculate that we perform a wavelet transform on the signals and
one of the parameters we have to set is the number of cycles for the wavelet.

The authors suggest that the number of cycles is

$nco = 6 f σ$

where $f$ is the frequency at which we are creating the wavelet transform at
and $σ$ is proportional to the inverse of $f$.

The authors mention that in most of their studies they used $nco$ between 3 and 8,
but I was wondering:

Is there any benefit in varying the number of cycles for different frequencies?

In my case I am calculating the Wavelet transform for a number of bands ranging
from 1Hz to 100Hz, so setting the number to a constant seems like a bad idea
given the wide spectrum of frequencies.

[1] : Comparison of Hilbert transform and wavelet methods for the analysis of neuronal synchrony


texts:
I'm currently working on the implementation of PRACH decoder for 5G NR. There are certain standards specified by 3GPP and we need to implement our module according to those standards. There is this particular equation that generates a continuous-time domain signal as the output, when fed with discrete frequency domain samples.

From what I understand, this equation depicts the entire process, starting from mapping symbols onto an OFDM grid to generating an analog signal.The antenna takes latter as the input.

The parameter LRA is 139, which is the length of my sequence. I sample the continuous time domain signal at a rate of 122.88MSPS , which gives me 8544 samples.The 122880 samples, are number of samples in a subframe of data. These 8544 PRACH time domain samples , are a part of these 122880 samples.

At the receiver, I receive these 122880 samples, extract my 8544 PRACH samples and perform the decoding operation.

Now, I need to implement the inverse of the standards equation, (shown in the picture below). , which takes in 8544 samples as input and gives out 139 frequency domain samples as output .

At the transmitter, the equation takes in frequency domain samples of length 139 and produces 8544 time domain samples as output.

At the receiver, the inverse of the equation should take 8544 samples and produce frequency domain samples of length 139.

Can anyone help me with finding the inverse of this equation?


texts: Signal chain for voice calls including adaptive noise cancellation, adaptive echo cancellation, and automatic gain control and their algorithms

texts:
I am trying to understand the entire signal chain and all the algorithms associated with adaptive filtering as mentioned in the case above. From my understanding:

Adaptive noise filtering (ANF)- can be performed with the help of Weiner filters, wavelet packet based auditory masking or subspace projections -- all these help in removing correlated noise. For uncorrelated noise, we can use a low pass filer? Gaussian filter bank in some way (need some guidance on this)?
Adaptive Echo cancellation (AEC) - draws some speech from the far end speaker and modulates it so it sounds like the "feedback" from the near user so it can be successfully cancelled out from the near-end input (uses NLMS and RMS)?
Automatic Gain control (AGC)- Look-ahead limiter?

From my understanding, the chain goes as follows:

Near end $\rightarrow$ Uncorrelated noise removal $\rightarrow$ Correlated noise removal + AEC $\rightarrow$ AGC.

Also how do Voice Activity Detection (VAD) and Discountinuous Transmission (DTX) work in this chain?

Is this correct? Can someone explain in detail about this?


texts:
I consider the potential of a nerve cell, which is -65mV. If I introduce a random noise source, for example, this leads to fluctuations (see attached picture).
I would like to know what is a good measure for current fluctuations / potential fluctuations? for example, if I form the RMS value, then again something in the order of the resting potential comes out... but I would like to have a robust measure for the amplitude of the random fluctuations.


texts: Cancel Drift after numerical integration

texts:
I am trying to integrate angular acceleration obtained from a set of accelerometers positioned specifically at opposite corners of a cube, based on the paper
EcoIMU: A Dual Triaxial-Accelerometer Inertial Measurement Unit for Wearable Applications

I am getting the angular acceleration on each axis.  This signal is quite noisy.

Then after integrating angular acceleration to angular velocity using the trapezoidal rule, I get signals which drifts heavily and randomly.

I understand that noise and also numerical integration are causing the effect. Other than low pass filtering the data, are there any other methods to reduce noise?

And the major factor for the drift is numerical integration, how can this be handled?


texts: I am relatively new to image processing and am working on a project that requires the thinning of binary images. In the literature, I've seen references to the Safe Point Thinning Algorithm(SPTA) quite a lot, but have failed to find any definitive source to the algorithm, maybe because most of the articles quoted to describe the SPTA are not in the public domain. Can you please explain SPTA for me? Or even point me to (free)resources that do? The pros and cons of the algorithm are welcome. I could also use any alternative algorithm that is "good enough".