texts: Methods for searching a large face database

texts:
I have a large face database, and I want to search through it. For example, if I input a new face image, the system would return the best N similarities.

I know that PCA, LDA, and Procrustes analysis are used for this, but it seems that I need to project all this large database into PCA space, and I don't know any library that can handle that.

Are there some tools, software, or a library for this?


texts: Matlab: Radix 2 FFT with 8 Channels and High Number of Inputs

texts:
I'm making in Matlab an 8 channel FFT, according to an online tutorial I found at https://www.youtube.com/watch?v=EsJGuI7e_ZQ&t=957s . It works fine for the same number of inputs as shown in the video (N=8), but as I increase N (say for N=128) it no longer works.

I am not sure why it no longer works as I increase N, but I suspect it has something to do with the twiddle factors. I assumed the twiddle factors would have an exponent increasing by 8 after each stage, but maybe they change in a different way as one increases N?

Here is a picture from the YouTube tutorial, at 15:16

Here is a signal flow diagram of my Matlab code

And below is my actual MatLab code. If one uses N=8 (which you can define at top of code) then output is correct. Using N=128 (or other higher values) produces an incorrect result.

I am very confused about what could be causing this problems with the output. Any thoughts?

Much appreciated,

clear all

% Generate input data sequence and plot
N           = 128;
f1          = 10;
num_cycles  = 2;
fs          = f1*N/num_cycles;
x_time      = 0:1/fs:num_cycles/f1-1/fs;
X           = sin(x_time*2*pi*f1);
plot(x_time,X);
title('Input Waveform');

% Split inputs into eight channels
X0_0  =  X(1:8:N);
X0_1  =  X(5:8:N);
X0_2  =  X(3:8:N);
X0_3  =  X(7:8:N);
X0_4  =  X(2:8:N);
X0_5  =  X(6:8:N);
X0_6  =  X(4:8:N);
X0_7  =  X(8:8:N);

% Compute FFT of each channel
X1_0  =  fft(X0_0);
X1_1  =  fft(X0_1);
X1_2  =  fft(X0_2);
X1_3  =  fft(X0_3);
X1_4  =  fft(X0_4);
X1_5  =  fft(X0_5);
X1_6  =  fft(X0_6);
X1_7  =  fft(X0_7);

% Generate Twiddle factors
Wn=exp(-1i*2*pi/N);

% Produce output of first stage of butterfly

for k=0:(N/8)-1
    X2_0(k+1)  =  X1_0(k+1) + (Wn^(k*8)) * X1_1(k+1);
    X2_1(k+1)  =  X1_0(k+1) + (Wn^(k*8+4)) * X1_1(k+1);
    X2_2(k+1)  =  X1_2(k+1) + (Wn^(k*8)) * X1_3(k+1);
    X2_3(k+1)  =  X1_2(k+1) + (Wn^(k*8+4)) * X1_3(k+1);
    X2_4(k+1)  =  X1_4(k+1) + (Wn^(k*8)) * X1_5(k+1);
    X2_5(k+1)  =  X1_4(k+1) + (Wn^(k*8+4)) * X1_5(k+1);
    X2_6(k+1)  =  X1_6(k+1) + (Wn^(k*8)) * X1_7(k+1);
    X2_7(k+1)  =  X1_6(k+1) + (Wn^(k*8+4)) * X1_7(k+1);
end

% Produce output of second stage of butterfly

for k=0:(N/8)-1
    X3_0(k+1)  =  X2_0(k+1) + (Wn^(k*8)) * X2_2(k+1);
    X3_1(k+1)  =  X2_1(k+1) + (Wn^(k*8+2)) * X2_3(k+1);
    X3_2(k+1)  =  X2_0(k+1) + (Wn^(k*8+4)) * X2_2(k+1);
    X3_3(k+1)  =  X2_1(k+1) + (Wn^(k*8+6)) * X2_3(k+1);
    X3_4(k+1)  =  X2_4(k+1) + (Wn^(k*8)) * X2_6(k+1);
    X3_5(k+1)  =  X2_5(k+1) + (Wn^(k*8+2)) * X2_7(k+1);
    X3_6(k+1)  =  X2_4(k+1) + (Wn^(k*8+4)) * X2_6(k+1);
    X3_7(k+1)  =  X2_5(k+1) + (Wn^(k*8+6)) * X2_7(k+1);
end

% Produce output of third stage of butterfly

for k=0:(N/8)-1
    X4_0(k+1)  =  X3_0(k+1) + (Wn^(k*8)) * X3_4(k+1);
    X4_1(k+1)  =  X3_1(k+1) + (Wn^(k*8+1)) * X3_5(k+1);
    X4_2(k+1)  =  X3_2(k+1) + (Wn^(k*8+2)) * X3_6(k+1);
    X4_3(k+1)  =  X3_3(k+1) + (Wn^(k*8+3)) * X3_7(k+1);
    X4_4(k+1)  =  X3_0(k+1) + (Wn^(k*8+4)) * X3_4(k+1);
    X4_5(k+1)  =  X3_1(k+1) + (Wn^(k*8+5)) * X3_5(k+1);
    X4_6(k+1)  =  X3_2(k+1) + (Wn^(k*8+6)) * X3_6(k+1);
    X4_7(k+1)  =  X3_3(k+1) + (Wn^(k*8+7)) * X3_7(k+1);
end

% Merge X4 into final output

c = 1;
for k = 1:N/8
    X5(c:c+7) = [X4_0(k);X4_1(k);X4_2(k);X4_3(k);X4_4(k);X4_5(k);X4_6(k);X4_7(k)];
    c = c+8;
end

% Plot expected FFT and Butterfly FFT
figure
matlab_fft=fft(X);
plot(abs(matlab_fft));
title('Matlab FFT');
figure
plot(abs(X5));
title('Butterfly FFT');


texts: why do we use $X(e^{j\omega})$ instead of $X(j\omega) $ in Discrete Time FT

texts:
I am studying DT-FT. But I cannot figure out why we use $X(e^{j\omega})$ instead of $ X(j\omega) $ in DT FT

Thanks in advance..


texts: frequency response of a signal in which two signal added in

texts:
Here goes the problem I faced:

Sig1= A*sin(w*n)
Sig2= B*sin(w*n+phi)

Length of both signal is L.

Then, I put them in F(1:2:2*L)=Sig1 and F(2:2:2*L)=Sig2.

Now we know what would be the frequency response of Sig1 and Sig2 but is there any way we can find frequency response of F? FFT of sinusoid is the delta function.

Thanks


texts:
I have to design a generic baseband filter. I have a C++ code which gives me filter coefficients based on the input parameters such as no. of taps, no. of bands, band edges, amplitudes and weights(code uses remez exchange algorithm).
I import the filter coefficients in MATLAB, do fft and plot the graph of it. I have to shift the graph such that its center is the center of baseband. I know that if I multiply filter coefficients with an exponential function and then do fft the resulting frequency domain output will be shifted in frequency $$x(t) e^{j 2\pi f_0} \implies X(f-f_0)$$. But I dont know how to do it practically. Do I just have to multiply my filter coefficient vector with an exponential like exp^(j*2*pi*f0) and then take fft and plot? I tried doing that but the results of both the graphs are exactly the same.


texts: LTI, causal, discrete time system output

texts:
Consider a discrete time LTI causal system $S: y = S(u)$, with its impulse response $h:{Z} \rightarrow R:h(n)=3^{n+1}{H(n)}$ with $H$ the Heaviside function. We know the values of input:

$$u(0) = 2$$
$$u(1) = 1$$
$$u(2) = 1$$
$$u(3) = 1$$
$$u(4) = 2$$

Also the $y(2) = 66$.
I'm trying to find the value of $y(3)$.

I may say, for a LTI, causal system the output is the convolution of the input with the impulse response:

$$y(n) = \sum^\infty_{k=0}3^{k+1}u(n-k)$$

Then

$$y(3) = 3u(3)+9u(2)+27u(1)+81u(0) = 201$$

Which is the correct answer! But I don't understand, why should I stop at $u(0)$ or why the negative values of the input $u(n), n< 0$ are zero here ?

Alternative solution:

recursion gives us this form:

$$y(n) = 3y(n-1)+3u(n)$$


texts: can you suggest me courses to start DSP?

texts:
I'm a cs student who's totally 100 % new to DSP can you recommend me math , physics and all the required courses so i can understand DSP better?
thank you
and also can you recommend some courses / books so i can study DSP?


texts: What is stochastic differential equation and its need?

texts:
A white noise process can be simulated using the Matlab command randn(). The numbers will be drawn from a Normal distribution of zero mean and variance 1.
Is the mathematics behind generating white noise a stochastic  differential equation which is numerically solved by stochastic Euler and Milstein methods ? A web tutorial https://me.ucsb.edu/~moehlis/APC591/tutorials/tutorial7/node3.html

presents the maths. What I could remotely follow is that the Euler method is used to convert a continuous system to discrete, I mean that the time to discrete. But in programming, we just call randn() to generate white noise.

For example, considering a model known as the Lorenz system.
The model is a system of three ordinary differential equations now known as the Lorenz equations:

\begin{align}
\dot{x} &= \sigma (y - x) \\
\dot{y} &= x (\rho - z) - y \\
\dot{z} &= x y - \beta z
\end{align}  .

If I want to add white noise to the $x$ variable: $$\dot{x} = \sigma (y - x) + w$$ then how would I do it? Should I generate w using w = randn(1,N) and then use this output to x?
Where will I use Euler method and the stochastic differential equation? Why use the stochastic differential equation to generate white noise when we can simply use the programming tools or is it illegal to use the programming tools and the correct method is to generate white noise using the math?


texts: The Definition of Q Factor by an Equation and How to Graph

texts:
I am currently building an EQ in an music app, and it's relatively simple:

6 bands of fixed center frequency, and a Q knob to control the Q of all bands, because we do not currently have space for separate Q knobs for each individual band.

The problem is that we need to draw an EQ graph according to the user's settings like the one usually seen on a sound board.

My current understanding is that the Y axis is measured in dB's and grows linearly, and the X axis is the frequency and grows exponentially (a Lin-Log graph, that is).

I have no problem drawing this, until the Q factor comes in. I know that Q makes the affected range larger if Q is smaller, and shrinks the affected range if Q is larger.

However, I do not not how to calculate the exact staring position and end position of the "bump" of that Peak EQ filter, if I'm given a center frequency of 1 kHz and a Q of 2.0.

What is the mathematical formula to compute the beginning and end of the curve?


texts: Does Discrete Wavelet Consider Sampling Frequency or Cutoff Frequency of Bandpass Filter?

texts:
I have EEG signal with a sampling frequency of 128 Hz, and filtered from 1-30 Hz using a bandpass filter. Now I want to know while decomposing the signal; does DWT decomposes it based on sampling frequency or cutoff frequency? Detailed Coefficients one should be 7.5-30 (if consider cutoff frequency), or 32-64 (if consider sampling frequency).
If we consider the cutoff frequency, we now that upper limit is a bit higher than 30, so how can we correctly justify it?
I am using python pywavelets and want to compute the frequency range of decomposed level.


texts: Determine when a constant signal changes to another constant value

texts:
As a novice to digital signal processing I have a scenario that probably seems trivial but I dont know the answer to. I want to detect when a signal changes but ignore noise.

  255 255 255 255 255 210 180 170 140 130 130 130 130 130 130

In the above signal there is a constant 255 value then it changes to a constant 130 value (with some noise in between). Is there a signal processing technique that can detect this, ie, it ignores noise and just detects the constant signal? Note the noise can persist for a while but we will always eventually get back to some constant signal value.

Context: I am learning computer vision as a hobby. My example signal represents grayscale intensity values (0-255). I want to detect the mode change, ie, detect when the most common value being seen changes whilst ignoring noise. I am aware of image gradients and gradient magnitudes identify areas of rapid signal change. However my signals wont always have a rapid change, they will always however have constant signal values between the change/noise. But this noise could be short or very long. Also the difference between the constant values could be very small or very larges. So it could go from constant value 255->240 or 255->0.


texts: What does a star shaped autocorrelogram mean?

texts:
Using the data in the upper graph, I get the weird autocorrelogram of the lower graph:-

I've never seen a autocorrelogram of this shape.  They're usually flat along the x axis.  Testing the code with simple sine waves produces the traditional flat bottomed graph. What causes the star shape, and is it valid or have I just done the processing badly? It seems specific to my data.

Python /numpy /scipy code:

correlation = signal.convolve(signalData, signalData[::-1], mode='full')


texts: Is it possible to find time delay of arrival using demodulated signals (of bandwidth ~200hz)? I have a setup in which I receive (multiple receivers, of course) modulated signal from a source. I want to find the angle of arrival of the signal. The signal is amplitude modulated. Due to hardware limitations, cross correlation of the raw data is not yielding good results. So I want to demodulate the signal, and then perform cross correlation using the demodulated ones. Will it yield good results? I googled it a bit and I can only find correlation calculations being done on the raw data. I was wondering that the raw data would consist of lot of noise and interference. So why not demodulate the data and then find cross correlation at least when the signals are analog modulated?


texts:
I am using Matlab function imnoise to add gaussian noise to one image. However, it seems that adjacent samples of the noise is correlated. I am using matlab code below to add noise.

 I = imread('eight.tif');
 J = imnoise(I, 'gaussian', 0, 0.02);
 figure; imshow(I);
 figure; imshow(J);

From the image, it contains many short vertical gray lines which maybe be image structures for some cases. Is the noise really additive white gaussian noise(AWGN)?

histogram of noise:


texts: Deriving 2-D discrete Fourier transforms

texts:
I have a problem in DFT. It was one of my past-year exam papers questions.

Question:

  Let $F(u,v)$ be the 2-D Fourier transform of a 2-D continuous function
  $f(x,y)$. Derive in terms of $F(:,:)$ the 2-D Fourier transform of
  each of the following functions

  1) $f(x,-2y)$

  2) $f(x+2y,y)$

I know how to do 1-D Fourier transforms but not 2-D. I'm not sure how to start on it and need some guidance.

For the second part, this was my approach. Please let me know if it's right or correct me if it's wrong.

Let $τ= x + 2y$ hence $x = τ-2y$ and $dx = dτ$
$$
\begin{align}
\mathfrak{F}\{f(x+2y,y)\}&=∬ f(τ,y)e^{−j2π(u(τ-2y) +vy )} dx\ dv\\

\mathfrak{F}\{f(x+2y,y)\}&= ∬ f(τ,y)e^{−j2π(uτ+(-2u+v)y  )} dx\ dτ \\
\mathfrak{F}\{f(x+2y,y)\}&= F(u,-2u+v)
\end{align}
$$


texts: Why is it called 'multi-level thresholding', if only the best threshold is selected?

texts:
I'm referring to Otsu's thresholding, and saw this from his paper:

When he says he's trying to maximize the between class variance of thresholds k* 1 and 2, is it the threshold with maximum value that is chosen? Is that what the "max" means? If it was just about selecting one threshold, why is it called multi-level thresholding?

On the other hand, if multiple thresholds are chosen, then why do we need to find the "max" of it?

ps: I'm trying to implement Otsu's method in a computational intelligence algorithm (Differential Evolution and Particle Swarm Optimization), and not a single research paper has explained clearly, how the thresholds are to be used for multi-thresholding. Not even the original Otsu paper.
Also, after implementing the algorithm, the image with the best fitness threshold is a different (much darker) threshold than what Matlab's greythresh threshold returns.


texts: How to Shift Carrier Frequency in QAM Signal?

texts:
If I wanted to apply a 100Hz frequency shift to a QAM signal with a 500MHz carrier frequency, I would

Demodulate it at the carrier frequency
Apply a frequency shift to the original signal
Modulate it again at the new carrier frequency

Is there a way to apply a frequency shift to the IQ values of a QAM signal without demodulating it?


texts: What is the difference between Lumped and Distributed systems?

texts:
What are the salient differences between Lumped and Distributed systems? In what contexts are distributed systems the appropriate model and in what are lumped systems the appropriate model?

Also, Lumped systems are said to be described by ordinary differential equations while the latter is said to be described by partial differential equations. Can someone explain why?


texts: Subtracting sensors output that have mutual inductnace between them

texts:
Background: The software that i use to anaylze my signals is matlab. I have two audio signals that were recorded using two magnetic sensors. Lets call one sensor A and the other one B. A and B have mutual inductance between them.

While sensors A and B are working, I would like to subtract the information that was received in sensor A due to mutual inductance from sensor B.

I tried to subtract signal B from signal A, by simply writing in matlab (A-B), but it gives me a wierd answer.
I think that it derives from a shift that I have in phase. The beginning recording time of the two tracks is the same, and therefore I think that it is not a time delay.

I would like to know how to do this subtraction process in theory, and if anyone have any tips how to implement it easily in matlab I would like to know.

I will really appreciate any help.

Thanks in advance.

Below I attached pictures of the signals graphs.
In the first pic you can see the signals that are received from sensor A and sensor B.
In the second picture, I plotted sensor A in red and sensor B in blue, in the range of 2.12:2.16 and zoomed in even more.


texts:
Could you please explain the step below, what is the benefit of it and how does it work. .
I do qpsk demodulation, do I started doing the meshgrid,

%%%%%%%de-qpsk
 sM = 2;
 [x,y] = meshgrid((-sM+1):2:(sM-1),(-sM+1):2:(sM-1));
 alphabet = x(:) + 1i*y(:);
 datadeqpsk=[];

 for k=1:N
    datadeqpsk(k) = alphabet((dataqpdk_be(k) alphabet)==min(dataqpdk_be(k)-alphabet)); % dataqpdk_be is the data
 end

datadeqpsk_R=real(datadeqpsk);
datadeqpsk_I=imag(datadeqpsk);
dataend=[];

Till now, all is ok, so what the benefit of below step? how does it work? could you please explain?

     for ij=1:N
         dataend((ij-1)*2+1)=(datadeqpsk_R(ij)+1)/2;
         dataend(ij*2)=(datadeqpsk_I(ij)+1)/2;
    end
      R_D_data_out=[R_D_data_out dataend];

thank you very much


texts:
I am running a BPSK flowgraph in GNU Radio which is based on RRC pulse shape. I noticed that the BER is quite poor when the number of taps is low. However, using the number of taps around $20\times Samples\_Per\_Symbol$ result in performance close to theory. I found the above number through trial and error and I was wondering if there was any general formula for determining the number of taps for RRC pulse shaping.

Regards,

Moses.


texts: Power Spectral Density of Finite Signals

texts:
I have a basic confusion which I hope someone can help clear.

Say I have two signals:

$S_1=\sin(2\pi t) \forall t\in[0,+\infty]$
$S_2=\sin(2\pi t) \forall t\in[2,5]$, $S_2=0$ otherwise

Now let's say the signals are sampled from t=0 to t=10. What would be the correct power spectral density (PSD) at 1Hz, in discrete time?

How would the answer change if I modify the sampling time interval, assuming the sampled interval always encompasses at least a portion of t=2 to t=5?

This, hopefully, will help me understand how to get the correct PSD out of STFT.

Edited to remove the word window and replaced with interval to avoid confusion.


texts: A-GPS is able to reduce the fd search range from several kHz (GPS search range) to several hundred Hz (a-GPS search range). I know the GPS search range has a center at 0 Hz. What is the center frequency with the reduced A-GPS search range? I got an impression that this A-GPS frequency search center shouldn't be located at 0 Hz. Instead, it should be the assumed initial fd value.


texts:
I have a question about matched filtering.  Does the matched filter maximise the SNR at the moment of decision only?  As far as I understand, if you put, say, NRZ through a matched filter, the SNR will be maximised at the decision point only and that is the advantage of the matched filter.  Does it maximise the SNR anywhere else in the output function, or just at the point of decision?

According to Wikipedia

  The matched filter is the optimal linear filter for maximizing the signal to noise ratio (SNR) in the presence of additive stochastic noise

This to me implies that it maximises it everywhere, but I don't see how that is possible.  I've looked at the maths in my communications engineering textbooks, and from what I can tell, it's just at the decision point.

Another question I have is, why not make a filter that makes a really tall skinny spike at the point of decision.  Wouldn't that make the SNR even better?

Thanks.

Edit:
I guess what I'm also thinking is, say you have a some NRZ data and you use a matched filter, the matched filter could be implemented with an I&D (integrate and dump).  The I&D will basically ramp up until it gets to the sampling time and the idea is that one samples at the peak of the I&D because at that point, the SNR is a maximum.  What I don't get is, why not create a filter that double integrates it or something like that, that way, you'd have a squared increase (rather than a ramp) and the point at which you sample would be even higher up and from what I can tell, more likely to be interpreted correctly by the decision circuit (and give a lower Pe (probability of error))?


texts: Question on understanding the time-bandwidth of a signal

texts:
I read from a paper (Ozaktas, H.M., et al. (1996) Digital Computation of the Fractional Fourier Transform) that says
The time-bandwidth product can be crudely defined as the product of the temporal extent of the signal and its (double-sided) bandwidth. It is equal to the number of degrees of freedom and the number of
complex numbers required to uniquely characterize the signal among others of the same time-bandwidth product.
I understand the first statement, but the second statement is hard to interpretate.
First, why is the time-bandwidth product equal to the number of degrees of freedom and what is the number of degrees of freedom of a signal? Does it hold for both the deterministic and random signal?
Second, why is there a (minimum) number of complex numbers required to characterize a signal? What if the number is not reached?
Hope you can help clarify these confusions.


texts:
I read about Time recovery (as an example, the  Mueller&Muller algorithm); it is linked to when you should  sample your signal.

I am currently working on a project with GNU Radio and there is some blocks that perform time recovery.

I don't get how those blocks actually perform a time recovery in the digital world because they can't change the sample that the USRP produces... I don't understand how such algorithm can be implemented  on the digital side with out affecting the USRP itself which is the device sampling the signal.


texts:
I am trying to implement iir Band Pass filter design in STM32F429i discovery kit.
I konw that it needs coefficients to be generated from matlab and feed them into cmsis api to achivi filtered data.

My SOS Matrix look like shown below:

1,  0,  -1,  1, -1.9974,   0.99743,
1,  0,  -1,  1, -1.9995,  0.99947,
1,  0,  -1,  1,  -1.9937,  0.99371,
1,  0,  -1,  1, -1.9982,  0.99817,
1,  0,  -1,  1, -1.995,  0.99499,

above matrix i put into my coeff array removing column 4th which contains all 1's since its A0 in coeff.

static float32_t filter_coeffs[] = {
1,  0,  -1,  -1.9974,   0.99743,
1,  0,  -1,  -1.9995,  0.99947,
1,  0,  -1,  -1.9937,  0.99371,
1,  0,  -1,  -1.9982,  0.99817,
1,  0,  -1,  -1.995,  0.99499,
};

here is the code snippet am using :

#define NUMSTAGES 5
static float32_t firStateF32[2*NUMSTAGES];
arm_biquad_cascade_df1_init_f32(&S, NUMSTAGES, filter_coeffs, firStateF32);

when I am using matlab my signal are filtered perfect, but in microcontroller output is initially oscillating and than "1.#QNAN"
am i missing any step??
please correct me.

Regards,
Lokesh Bhatt


texts:
What is difference between repeated poles and distinct poles?
As far as i am able to understand is that repeated poles are those that have same value of both x and y coordinates while distinct poles are those that have either same value of x coordinate or y coordinate but neither both


texts:
To remove the Doppler shift, we can use a bank of matched filter. But, to use this method, we need an interval $[-f_{max};f_{max}]$.

How can we approximate this interval?


texts: Making audio clips comparable in terms of RMS

texts: I have a challenging question on how to normalize several audio clips so that they are comparable (similar) in RMS but without the clips clipping (having values over -1 and 1). Is there a systematic way to do this? One scaling factor must be found for all clips so that their L/R channels keep their ratio while at the same time making the different clips' RMS equal. Thanks in advance!


texts:
I recently came across an article on the inventor of adaptative equalizer Robert Lucky, In this article : An Oral History by Robert Lucky (http://www.ieeeghn.org/wiki/index.php/Oral-History:Robert_Lucky).

And I have a couple of questions :

Quoting Lucky speaking about DFE :"It was the idea that you could use your own decisions to improve correction ability.  When you start transmitting data and the channel is very corrupted the bits you’re getting have a lot of mistakes in them. Nonetheless, you say, “Let’s assume these bits are correct and reconstruct what the perfect signal would have looked like with these bits. Compared to what the signal actually was, we’ll just try to make them look alike with our adaptive filter. ” You're basing this model on corrupted bits on the outside, so that the question is, “Is this ever going to converge ?” " ?

Can some one elaborate on this and expain how the DFE equalizer is assure to converge and provide better equalization than the simple forward filter system ?

My second question is about the design of the filter, I choose to use an MMSE criterion, is that the best alternative ?
My DFE equalizer is for HF ionopheric channels, how can I update the filters coefficients, i.e., based on the channel estimate, what is the exact algorithm ?

Any Hints, thoughts, or ideas will be very appreciated


texts: Is there a way to calculate modulation depth after the modulation process?

texts:
Suppose I have some amplitude modulated carrier wave $x$. If I have no access to the original message wave nor the unmodulated carrier, is it some how possible to calculate what is the modulation depth of $x$?

If I have understood this correctly, amplitude modulation depth is given by
$M/A$, where $M$ is peak amplitude of the message wave and $A$ is the peak amplitude of the carrier wave. From $x$ I will know that $M/A$ equals to some $\lambda$ (when I check its peak amplitude), but M and A could be anything.

Please correct me if I have understood something incorrectly.


texts:
I am reading a recent paper titled "Phase Estimation of Speech Enhancement - unimportant, important, or impossible?" by Grekmann et al. published in the 2012 the IEEE convention. The paper proposes an algorithm for estimating the phase of the noisy speech.

can anyone help me please on understanding what is meant by "angular frequency of the harmonic component dominant in band k" ?

Thanks in advance


texts: Chirp resolution as a function of bandwidth

texts:
My question concerns about the Chirp resolution during the crosscorrelation as a function of the sampling rate and available bandwidth. Suppose at a transmitter a chirp signal is transmitted (ranging in bandwidth from f1 to f2) and at the receiver, the cross-correlation is performed to obtain the peak of the chirp from a "sync"-like output function. I except that given a sampling rate at the receiver the minimum error is proportional to the sampling rate as the peak can be founded between two samples. However, in the radar system, the resolution depends also in the bandwidth in order to detect two chirp peaks between them (maybe here resolution has another meaning). Higher the bandwidth shorten the peak width and higher the resolution to distinguish two objects. However, this is not my case as the only chirp is transmitted a given an ideal case at the receiver (with no echos) the peak detection should depend only on the sampling rate(!?).

Is there any other relationship with the available bandwidth which the signal is distorted and any other effects influence the detection and the resolution (at least theoretically)?

For anyone interested I found this tutorial for the radar system http://www.mouser.cn/pdfdocs/FUnofMMWave.pdf

Regards,


texts:
I'm trying to virtualize a camera from a panorama.

That is, suppose I have a really big picture, for example: a soccer field.

Then I want to simulate a camera that focuses on certain regions of the game.

My initial idea was to use the essential matrix to carry out this task.

Ideally, it would be simply to calculate a homography but as the calculation using only the parameters of the virtual camera?


texts: I am trying to implement the following 4-Tap Polyphase window shown in figure below and used in : polyphase filters- radio astronomy: lecture #8 by Prof. Dale E. Gary on Matlab. I have tried splitting the window in time domain after multiplication with Sinc function but has not achieved the sidelobe level and mainlobe width shown in green graph- figure on right. I am not sure what I might be missing here.


texts: Why does QAM use two cycles instead of one per byte?

texts:
If you look at this image, you can see that you have 256 possible binary values by modulating the amplitude (the radius of the trigonometric circle) and the phase (the degrees) of the carrier.

However, multiple diagrams like this one show that each value is actually two cycles long.

My question is why is there two cycles per value instead of one cycle? The constellation only goes to 360 degrees, so why is two cycles used? Wouldn't you be able to transfer data 2x faster if you used one cycle per value?


texts: resampling from fractional to integer sampling rate

texts: I have data recorded at 1000Hz and other physio data recorded, somehow, at 1960.8 Hz (510 microsecond samples). Ideally, I would like to be able to downsample the 1960.8 hz signal to line up with the 1000Hz signal.  Any suggestions? I am familiar with matlab or Python.


texts: Converting very short "motionless" video frames to single, better-resolved, images

texts:
I made a mistake with my newly bought compact camera, before a trip to Japan. Instead of taking single pictures, I ended up with a few short "MP4" video files (1 second, 2-3 frames). I could "easily enough" extract individual frames with ffmpeg, using help from:

Extract all video frames as images with FFMPEG
Extract images frame by frame from a video file using FFMPEG
Fastest way to extract frames using ffmpeg?
How can I extract a good quality JPEG image from an H264 video file with ffmpeg? [NOT TRIED YET]

I am unsatisfied with the quality of some frames, and as there is very little motion, I would like to restore or recreate a superresolution image from those two-three frames only, using the motion vector.
I would appreciate suggestions, software experience, etc. For readers interested in trying algorithms, I provided in the 22 MB file StackExchange-AVI2JPG.zip two examples with media information (obtained with MediaInfo) and camera reference (to avoid unwanted advertizing). One leaving Osaka, with a relatively nicely flat image:

the other from Nara, Todai-Ji:

where the wire fence is sharper, hence the individual frame quality is poorer. I enjoyed my trip, and would be glad to share crisper images of the first day (a view on the Fuji in the early for the finest eyes).


texts: Extending 1D window functions to 3D (or higher)

texts:
(cross post of SO: https://stackoverflow.com/questions/27345861/extending-1d-function-across-3-dimensions-for-data-windowing )

For the sake of image (volume) registration, I'd like to apply a windowing function to input data, such that the non-periodic image boundaries do not cause streaking in the FFT. I'm using the example from here for 2D data:

http://mail.scipy.org/pipermail/numpy-discussion/2008-July/036112.html

h = scipy.signal.hamming(n)
ham2d = sqrt(outer(h,h))

Is this extensible to 3D or even N-D?


texts: Power Spectral Density from Probability Density Function

texts:
The samples of a signal $x[n]$ are i.i.d. and follow a triangular pdf with $a = 0,\ b = 2,\ c = 1$:

The DC-power of the signal is
$$\mu_x^2 = \big(\mathbb{E}(X)\big)^2 = \left(\int_{-\infty}^{\infty} x f_x(x)dx\right)^2 = 1$$
the total power of the signal
$$\mathbb{E}(X^2) = \int_{-\infty}^{\infty} x^2 f_x(x)dx = \frac{7}{6}$$
and the variance (AC-power) as
$$\sigma^2 = \mathbb{E}\big((X-\mu_x)^2\big)= \mathbb{E}\left(X^2\right)-\mu_x^2 = \frac{1}{6}$$.
Thus I thought, that the PSD of the signal has the following form:
$$ S_{xx}(e^{j\omega}) = 2\pi \delta(\omega) + \frac{1}{6}$$
as the AC-power results in a constant value over the whole spectrum and the DC power in a Dirac-Delta at $\omega = 0$. Furthermore, the integration over the PSD should return the total power of the signal:
$$ \frac{1}{2\pi} \int_{-\pi}^{\pi} S_{xx} dx = \mathbb{E}(X^2) $$
Is my solution correct or did I miss something? Can this procedure be done for every probability density function under the assumption that all samples of $x[n]$ are iid?


texts:
I am trying to segment warped text lines found in photos taken from a page of a book (from the camera of a smartphone). This is meant as a preprocessing step before running OCR on them.

I have found two relevant papers on this:

https://sites.google.com/a/iupr.com/bukhari/home/papers/Bukhari-Coupled-Snakelets-IJDAR12.pdf?attredirects=0

https://www.researchgate.net/profile/Rafael_Lins/publication/221000335_An_Efficient_Algorithm_for_Segmenting_Warped_Text-Lines_in_Document_Images/links/0fcfd5063a49cc779c000000.pdf?origin=publication_detail

I read the papers but they're too hard to implement, can anyone help?

Example input no.1:

Example input no.2:


texts:
Part of my project is to build heart rate monitor from Nano and a PulseSensor. I am having trouble working with the Fast Fourier Transform part of the code.

This code here is from a library (arduinofft) that can be found in the arduino IDE. When testing the arduino the serial printer returns values of about 51 bpm, which is far to low, compared to other devices of about 70bpm.

What i have done:

changed the sampling frequency to 5.6Hz to get the range of 0 to 2.8Hz range for the hate rate
edited the library to only take the last 25 to 128 samples (only when computing the max peak), to off-set the DC. Previously getting readings of 5 BPM

What i don't understand:

the sampling period, if the samples are taken and put into an array every second what does the period do.
Also if samples are taken every second is this enough to get a good reading on a heart rate shouldn't the sample be maybe of 15-30 seconds?
If this is so, should i put another array at the bottom. To capture the results every second upto 15 or 30, print the average then first in first out  the array of new values?

#include "arduinoFFT.h"

arduinoFFT FFT = arduinoFFT(); /* Create FFT object */

#define CHANNEL A0
const uint16_t samples = 128; //This value MUST ALWAYS be a power of 2
const double samplingFrequency = 5.6; //Hz, must be less than 10000 due to ADC

unsigned int sampling_period_us;
unsigned long microseconds;

double vReal[samples];
double vImag[samples];

#define SCL_INDEX 0x00
#define SCL_TIME 0x01
#define SCL_FREQUENCY 0x02
#define SCL_PLOT 0x03

void setup()
{
  sampling_period_us = round(1000000*(1/samplingFrequency));
  Serial.begin(115200);
  Serial.println("Ready");
}

void loop()
{
  /*SAMPLING*/
  for(int i=0; i<samples; i++)
  {
      microseconds = micros();    //Overflows after around 70 minutes!
      vReal[i] = analogRead(CHANNEL);
      vImag[i] = 0;
      while(micros() < (microseconds + sampling_period_us)){
        }
  }

  FFT.Windowing(vReal, samples, FFT_WIN_TYP_RECTANGLE, FFT_FORWARD);    /* Weigh data */
  FFT.Compute(vReal, vImag, samples, FFT_FORWARD); /* Compute FFT */
  FFT.ComplexToMagnitude(vReal, vImag, samples); /* Compute magnitudes */
  double x = FFT.MajorPeak(vReal, samples, samplingFrequency); /* Compute largest peak*/
  double y = round((60/(1/x)));
  Serial.println(y);  //print bpm
  delay(2000); /* Repeat after delay */
}

Thanks for any help


texts:
I am studying this paper.

In one of the figures in the paper (Fig 5.b and Fig 5.c) DWT architecture is given using db2 and filter bank.

I don't understand how Lo_D and Hi_D have size half of input image size? If we see the figures there is no downsampler. Then how the size of the Lo_D and Hi_D have half the size of image (either row wise or column wise)?

Please explain me how single level DWT is implemented using filter banks? How the size of the decomposition values is half of the input (i.e. image) when filter banks are used to implement DWT?


texts: Kalman filter, defining the measurement model

texts:
I would like to implement a Kalman filter to estimate the velocity and position of an object. I have an accelerometer, therefore the acceleration is known. The approach is same as:

Kalman filter for position and velocity: introducing speed estimates

however, I don't understand well, how I should define the measurement model:

$\hat{X}(k+1) = \hat{X}(k) + K * ( y(k) - H*\hat{X}(k) );$

K is the kalman gain and is calculated in every step, but What is my "y" here, i know it is called the observations, but how i have my observations ? should i calculate the:

$v(k+1) = a(k)*t + v(k);$

$x(k+1) = 0.5*a(k)*t^2 + v(k)*t +x(k);$

Thank you!


texts:
I observed than people often compute the DFT of a signal using FFT and just observe the peaks in the "modulus VS frequency" diagram (kind of a power spectrum density). Obviously only half of the information appears in this diagram and it is not possible to retrieve the original discrete signal from this plot only.

Question: In practice, in which cases is the "phase VS frequency" plot needed or not?


texts: Extra frequencies after applying low pass filter

texts: I used Python/scipy to create an input data (sinewave with frequencies {600,1200,1800,2400,...,9000}) and sampling at 10000Hz. A lowpass filter is created using butter(10, 4000/(10000/2), 10000, btype='low'). After filtering the filter using lfilter function, I plotted the FFT of the input data the filtered data, I found some extra frequencies in the FFT graphs. I think it should show the frequencies at {600, 1200,...,4800}. Where are these extra frequencies from? and how to remove them?


texts:
There are a plethora of tools, both commercial and free, which I have found online for designing filters. The ones I have tried (so far) prompt for frequency response, number of steps (for FIR), then generate coefficients and a frequency response plot.
Question: are there any particular sites or programs, which allow you to input or modify the coefficients? Free would be preferable, but (especially for an FIR with a large number of taps) commercial will do in a pinch.
(Matlab is too expensive for me, but I've heard of freeware Octave: if anyone recommends it for filter design I'd be willing to try it out)


texts: PC-to-PC data communication over Sound FSK / PSK / DSSS

texts:
For fun and work I've to implement a java based application that can Encode text or data to sound and transmit using PC's speaker and on the receiving side is a microphone with decoder software.

I was thinking of using FSK (syn or async or suggest) for the implementation:

Text (data) ---modulate---> 10khz-20khz audio carrier wave ---> Over the air transmission ---> microphone -> demodulate ---> Display text or data.

My main considerations are:

~200bps bandwidth if not more
resilient to noise upto certain level
preferably 16khz - 20khz carrier wave with 44.1khz sampling (there's less noise in this area and its not really audible to older people and mics, speakers are cheap, readily available in laptops)
Not too complex coding logic.

What Modulation would work best with least coding efforts? Any recommendations on libraries/samples for achieving FSK/BFSK/PSK or DSSS using java?


texts: Measuring the "frequency stability" of a signal

texts:
I'm thinking about ways to automatically identify and analyze lots of musical instrument samples, and would like to find the part of the sample that's the most stable in frequency, without any accidental vibrato or anything.  My first thought was to do a sliding FFT and find the "width" of the peaks (maybe fitting a parabola to many of the neighboring points?), since a constant frequency chunk will produce a narrow peak (green) and one wavering in frequency should produce a wider peak (red):

On a spectrogram the red is a slightly wiggly line, and the green is a more straight line.

Time domain is ok, too.  Some kind of "slide the signal past itself and look for sections that interfere with each other in a constant way instead of phasing in and out"?

But I'm not sure how easy or reliable this method would actually be.  Any other ideas?


texts: Would the following frequency response be considered linear phase? I know that linear phase is when the phase response is a linear function of frequency. However, the phase response is only linear from ~0.3 so I'm not sure if it is considered "linear".


texts: Segmentation step when using feature descriptors

texts:
In my final year project, we are using a SIFT feature descriptor to classify and recognize objects, but I have never come across segmentation in the process of image classification/categorization.

Isn't this step necessary?


texts:
If the DTFT of discrete sequence $x[n]$ is $X(e^{j\omega})$, what is the DTFT of $g[n] = x[2n]$?

I see the textbook answer is

\begin{align*}
  G(e^{j\omega}) &= \frac{1}{2} \left( X(e^{j\omega/2}) + X(e^{j(\omega-2\pi)/2}) \right)
\end{align*}

My start of the problem:

\begin{align*}
  X(e^{j\omega}) &= \sum\limits_{n=-\infty}^\infty x[n] e^{-j\omega n} \\
  G(e^{j\omega}) &= \sum\limits_{n=-\infty}^\infty g[n] e^{-j\omega n} \\
  G(e^{j\omega}) &= \sum\limits_{n=-\infty}^\infty x[2n] e^{-j\omega n} \\
\end{align*}

How do I derive the given textbook answer?

UPDATE:

I try the obvious $m=2n$ substitution, however I don't see how you can change the variable on the summation so that it counts by 2?

\begin{align*}
  G(e^{j\omega}) &= \sum\limits_{n=-\infty}^\infty x[m] e^{-j\omega m/2} \\
\end{align*}


texts: Acoustical Design considerations for Active Noise Cancellation Project for Air vent

texts:
I am working on ''Active noise cancellation for air vent'' project. I am
using NI myRIO1900, Audio Technica ATR 3350 omni directional microphones
and Tevion Loudspeakers. I have done the programming using LabVIEW and I
have used FPGA module.

I am using sinusoidal noise source of (200-500 Hz) as test noise signal.

I have implemented LMS on LabVIEW, as a preliminary results I am getting
around 8dB noise reduction but these results are pretty random in a sense.

Only at certain volume levels( if I adjust very carefully), the noise
cancellation is happening and the variation in step size is not giving any
decent change ( again I have to make volume level changes to see some
results).

Over all, I am getting some results but I don't have control over the
results.

This is my set up

[the pipe length is 1 meter]

I know I have to consider secondary path modelling and feedback modelling.
I have actually completed the coding of FBFxLMS also but I don't have any reasonable results with this also.

But my question is how to improve the acoustical design of my setup.

What are the problems using just cardboard material to simulate the environment of air vent?

I have read in 2-3 places (here in 2nd answer) that without proper acoustical design it is not possible to reduce the noise effectively.

Quoting from a paper

  If the acoustical design of the system is not optimized,the digital controller may not be able to attenuate the undesired noise adequately.

The only point I am aware of is using low frequency noises (<= 500Hz) to
consider the sound wave propagation as plane acoustic wave. I am
completely unaware of any other details on how to better my acoustical
design.

I am wondering how to find the limitations of how much a DSP will affect and how much the actual acoustic design. If anyone can provide some reasonable resources to go through, it will be highly appreciated.


texts: Is there an optimal way to quantize log-likelihood ratios of an AWGN channel?

texts:
My understanding is that given an AWGN channel and BPSK modulation, an LDPC decoder that uses message passing takes as input log-likelihood ratios $L$ of the following form by Bayes' rule:
$$
L=\frac{P(a=1|r)}{P(a=-1|r)}=\frac{2}{\sigma^2}r
$$
where $a\in\{\pm1\}$, $n\sim \mathcal{N}(0,\sigma^2)$, and $r=a+n$.
I have been referencing page 22 of this report, which uses a uniform quantizer and mentions that a larger dynamic range results in larger step sizes assuming a fixed number of bits.
Are there other quantization methods that might be better suited to the Gaussian nature of this channel? Said differently, are there quantization methods that better account for $\sigma^2$?


texts: How do we actually obtain samples to form discrete time samples?

texts:
I'm in my second week of an online DSP class and I'm still kinda lost on some of the concepts of what we are actually doing.  I'm hoping you guys can help clear up my understanding.  Please forgive me if what I'm asking makes no sense.

I'm reading about continuous time sampling, which I don't think I fully understand yet, and discrete time sampling.  But I guess to understand those concepts I really need to understand sampling.

I think sampling is gathering discrete data points from a continuous time signal?  But how?  How is this physically done?  What are we using to get the actual data to convert it into a discrete time sample?  Is there a good example I can look at to understand this more?

Right now the text book just shows math formulas, pictures of graphs of sines with various frequencies and amplitudes, and with dots representing discrete time samples vs continuous time samples - but no application of what is actually happening?  For example, is an instrument making a consistent sound, that is being captured through some microphone and producing the signal, which is then passed through some system that calculates data points?

Is a continuous time signal just a signal being actively captured and a discrete signal just data points over a certain period of time?  How and when do I apply the mathematics we are learning about (as we haven't needed to really do so yet)?


texts: Unexpected Result When Using Sinc Interpolation

texts: blue is how I tried to sinc interpolate. why would something like this happen?


texts: What does the visual representation of matched filtering of images look like?

texts:
So I am using the Source Extractor to find point sources in my images and it offers the possibility to use matched filtering to enhance the detection results. In the documentation they also claim that the matched filter defaults to a convolution of the data, should the noise be equal across the field (please correct me if I got this wrong). While there is a nice and easy to understand visual reprentation for the convolution, where the convoluted pixel value is simply the sum of the pixel values "below" the kernel weighted by the factors in the kernel "above", I have yet to find a similar explanation for what is going on in matched filtering.
I also like how the matched filter is derived in terms of matrices, since I feel like this makes the most sense with image processing (unlike the derivation using itegrals I found in many places), but I haven't found a book yet where this is well explained. Can someone point me to a source where matched filtering is explained regarding image processing?


texts: What is a window function in DSP and why do we need it?

texts:
When designing digital filters we start off with FIR and IIR. Later on we talk about window functions e.g Kaiser and Hamming windows.

I do not understand why we need so many type of window functions described by rather complex mathematical equations and how they relate to FIR and IIR.


texts: Entropy of a dynamical system and source code length

texts:
The entropy of a source $H(S)$, gives you the average codeword length to encode a given source alphabet. i.e. it is the average number of bits per symbol required to encode the information in the source. If: $p_0=3/5$ and $p_1=2/5$ (close probabilities) with $H=0.971 \textrm{ bits/symbol}$, then there's more information than compared to the 2nd case where $p_0=3/4$ and $p_1=1/4$ yielding $H = 0.8113 \textrm{ bits/symbol}$ to encode. Following are the problems that I am facing and I will be very grateful for a detailed answer.

In general, if the source entropy is $H$ then what should be the minimum number of bits if the alphabet is $0,1$ ?
In case of discrete chaotic map say Logistic map, the entropy is $\log \lambda$ where $\lambda$ is the largest Lyapunov exponent. What should be the length of the time series in binary or what should be the length of the symbolic representation in binary of the initial condition?


texts: Step by Step Camera Pose Estimation for Visual Tracking and Planar Markers

texts:
I have been working on the topic of camera pose estimation for augmented reality and visual tracking applications for a while and I think that although there is a lot of detailed information on the task, there are still a lot of confussions and missunderstandings.

I think next questions deserve a detailed step by step answer.

What are camera intrinsics?
What are camera extrinsics?
How do I compute homography from a planar marker?
If I have homography how can I get the camera pose?


texts: Difference between demodulation and band-stop Filter

texts: I was wondering what is the difference between demodulating a signal that is carried with a frequency $F_{\rm carrier}$ and applying a band-stop on a band around $F_{\rm carrier}$ ?


texts:
I'm just beginning to learn (FIR) filter design and I was wondering, why is $\pi$ involved in the domain of such filters?

I assume it's related to some trigonometric functions, but why do I see e.g. cutoff frequency being related to $\pi$?

You can see for example here that the variable $\omega \in [-\pi, \pi]$ in function $z=e^{i \omega} $ of the transfer function of a FIR filter:

https://en.wikipedia.org/wiki/Finite_impulse_response#Transfer_function


texts:
I have the following image:

and I would like to fill in its contours (i.e. I would like to gap fill the lines in this image).

I have tried a morphological closing, but using a rectangular kernel of size 3x3 with 10 iterations does not fill in the entire border.


texts:
I'm new to python and I'm using it to analyse accelerations from an accelerometer ie. vibration analysis. For that I need to plot 2 types of diagrams:
1) Frequency map; frequency and time on the axis with the amplitudes,
2) Order map; order and time (or RPM) on the axis with respective amplitudes.

The data from the sensor is sampled at 1 kHz and include the accelerations in X,Y and Z, pulses for every shaft rotation and the timestamps (in microseconds).

I wrote a small code for the frequency map and plot them using scatter() and it gives me this plot.

The green "lines" correspond to the RPMs and the order; accelerating and decelerating the shaft.

I then found that scipy has a builtin spectrogram() and pcolormesh() function, which should give me something similar. I used it on my data and got this:

Note: axis are flipped

The "RPM lines" are barely visible. So I used log to scale the colours and got this:

And this is still weird looking.

The problem is with my code and using scatter, the points overlap. And if I used smaller points, then they look strange when opening the diagram in full screen.
Is there any way to get the plots to look better? Whether using the spectrogram() function or using something like scatter() ?

Also, how can I plot the order map? I don't know how to change the data from time/frequency domain to order domain.

Here is a link to understand what I'm trying to implement:
https://de.mathworks.com/help/signal/examples/order-analysis-of-a-vibration-signal.html

Much thanks in advance!


texts: Expected value of a quantized noisy signal

texts:
I am given a noisy signal $y(t) = x(t) + w(t)$, where $x(t)$ is my desired signal and $w(t)$ is the noise. In my scenario, the noise is very strong, much stronger than the desired signal $x(t)$. However, I know it is zero mean. Hence, if I can oberve $y(t)$ directly, I can recover $x(t)$ by averaging since ${\mathbb E}\{y(t)\} = x(t)$.
However, in practice I need to replace the expected value by averaging over realizations and this can only be done in digital domain. Hence, I only have access to a quantized version of $y(t)$, quantized to some finite number of quantization levels $L = 2^b$. Now my question is, can I hope to still recover $x(t)$ from averaging a quantized version of $y(t)$, i.e., is ${\mathbb E}\{Q\{y(t)\}\} = x(t)$ under some conditions on the quantizer (and, maybe the noise)?
Numerical evidence seems to suggest it works, even under very coarse quantization, i.e., when one level of the quantizer is much bigger than my desired signal $x(t)$. My intuition here is that it kind of works like dithering: the small addditive $x(t)$ alters the statistics of $w(t)$ slightly such that the quantization levels shift slightly, which allows to recover $x(t)$.
My other thought in this direction is that under some conditions, quantization can be treated like additive noise and the randomness of $w(t)$ may lead to noise realizations being uncorrelated over realizations in the ensemble.
Can we back this intuition by a more rigorous analysis and what would be the right tool for this? Are there limits to when and how this can work? Are there other reasons that could prevent this from working in practice?
In case the background matters: I need to detect very weak signals in measurements but I can repeat the measurements many times and each time, the signal will appear in the same spot (in time) so in theory even if in each measurement my desired signal is much below the receiver's sensitivity, I should be able to recover it by averaging enough trials. I think people do things like this in areas where we need to go to the extremes regarding sensitivity, e.g., astronomy/physics and the like.


texts: Fourier transformations of discrete time signals

texts:
How does one Fourier transform the following signals? $$x[n]=[0,9,0]$$ and $$y[n]=[9,0,19,0,9]$$
I've tried to get it along the way of $$X[\omega]=e^{-i\omega n}$$
but this seems incorrect. I'm not sure how the second one is supposed to be handled as well.


texts: Are there DC removal techniques that do not introduce a filtering transient?

texts:
I have an application in which I need to remove DC components from a sampled signal in real time (basically the same constraints of ECG, but it has nothing to do with the brain). My measured signal in in the single µV range and the undesired offset wanders around and can be as high as tens of mV.

In this application, fast electrical stimulation is introduced which can reach hundreds of volts and can introduce a measurement artifact of nearly a volt. This stimulus is basically an impulse from the point of view of the processing.

Currently I am using a 200Hz 1st order highpass, as this has an acceptable artifact (i.e., impulse response) after the stimulus. Higher orders are not needed, and these are undesirable as it would make the artifact worse.

My problem is that the actual application will require filters to go down to 1Hz or even lower (in some cases we use 0.05Hz, as this is above the frequency content of the "wandering"). A filter at these frequencies would have an unacceptably long impulse response.

Are there any other techniques that would remove the DC-wandering without having the impulse response artifact problem?

Addendum:

The way this problem is usually handled involves knowledge of the location and duration of the disturbance (whose description I simplified for this question). This enters the category of evoqued response and involves some non-linear processing. Some of the alternatives I have tried:

Blanking the interference before it hits the filter. This requires precise synchronization that is not always available.
Remove the real-time aspect and process the data non-causally. Long data records are still required due to filter transients, initial conditions are critical (and, of course it is not real time).
Model the transients and remove them with data fits. Precise synchronization is no longer needed, but this might introducers own artifacts.


texts: DWT and FFT on a very low frequency signals

texts: I am trying to extract features from a very low frequency signal of $0.1$ HZ and less than $100$ samples. Is it advisable to use FFT and DWT on this signal?


texts: Convolution involving turning each pixel value to the most represented pixel value of the neighbourhood

texts:
In order to correct gradual changes of intensities in the background of grey-scales images, I have been blurring them and then subtracting the original images from the convolved one.

In some cases, I have seen improvement using median blur instead of blur.

I was therefore wondering if I could go further and use a filter that convolves a grey-scale image so that each pixel will take the value of the most represented pixel value in the histogram of a rectangular neighbourhood.

Do you know the name of this convolution ?

Are you aware of any implementation in OpenCV ?

Thank you very much,


texts: How to know the time of my window to calculate the STFT with python knowing only the length?

texts:
I am trying to implement a work presented in an IEEE paper where they have mentioned that the STFT was performed on the signal measurements to obtain a spectrogram with no overlap window of 3 min :

I have used the following code :

f, t, STFT = sc.signal.stft(phase_meas, fs=1.0, window=????, nperseg=180, noverlap=None,
                              nfft=2048, detrend=False, return_onesided=False, boundary='zeros', padded=True,
                              axis=-1)

My problem is that I am not able to know the window's type because they did not mention that in the work, Only they have indicated that the size is 3 minutes and knowing that my sampling rate is 1Hz so each block must contain 180 samples that's why I had set the nperseg to 180.


texts:
I am struggling with the following problem for a while: If I have signal of duration N and I apply window (assume rectangular window) of size M < N how will this influence PSD of that signal after doing fft?

PSD of signal should be scaled (I assume) but by which amount and what is the mathematical explanation behind it?

Thank you for your answers in advance.


texts: What is the physics behind the width of a main lobe?

texts:
We know that the square window gives the lowest main lobe width possible, and that other windows after that trade main lobe width for side lobe height. I also understand that the main lobe width is inversely proportional to the length of the DFT aperature.

Given this, is there then a physical limit to how narrow a main-lobe can be, for a fixed aperture length? For example, can we ever hope to have main lobes that are narrower than that given by a square window, (for a fixed aperture length again), via windowing or any other method?

A second related question I have here has to do with energy conservation - is the interpretation that windows trade side lobe height for main lobe width, because energy must be conserved? Thus any reduction in side lobe height means the energy "has to go somewhere" and ends up in the main lobe? Would this be a correct interpretation?


texts: Relationship between the Real and Imaginary parts of a LTI causal system

texts:
Prelude

I am writing an elaborate text on the relationship between the real and imaginary parts of a LTI causal system and how stability, causality and analyticity imposes various constraints on its magnitude response and the phase response. I am trying to explain three topics

Kramers Kronig Relationship
Bode's Gain-Phase Relationship
Hilbert Transform relationship

And finally, explain the connection between the three and their practical implications. This, I feel, is a much-needed text for people like me entering into this field. I have a list of questions, which I feel must come under the same context - please be patient in answering and kind enough to point out any mistakes.

Questions

The text, Kramers–Kronig Bode and the meaning of zero by John Bechhoefe, provides a short derivation of the gain-phase relation.

What is the motivation behind taking the logarithm of the response function in deriving the gain-phase relation?

Kramers Kronig (KK) relation requires only a causal system (analytic in the upper half of the complex $\omega$-plane) and does not talk about stability.

The Bode's Gain Phase relation requires a minimum phase system with no zeroes in the upper half of the complex $\omega$-plane and for non-minimum phase it becomes an inequality. In other words, Bode's Gain-Phase relationship necessitates that the response function must obey KK relations.
So, is the Gain-Phase relation a special case of KK relations accounting for stability too?
Causality in time domain implies analyticity in frequency domain, vice-versa.  Is my statement true?
How are Hilbert transform relationship and KK relationship related?
By Hilbert Transform relationship I mean the following (for a discrete case):
$$ H_{Im}(\omega)=-\frac{1}{2\pi}\int_{-\pi}^\pi H_{Re}(\lambda)\cot(\frac{\omega-\lambda}{2})d\lambda. $$
For a given response function $H(\omega)=H_{Re}(\omega) +j H_{Im}(\omega)$.
How do these relationships extend to higher dimensions? (for images and videos).

Thank you for your patience.


texts: What benefits can we get from the use of GFDM?

texts:
Existing literatures say that the generalized frequency division multiplexing (GFDM) has lower out-of-band emission (OOBE) levels compared to orthogonal frequency division multiplexing (OFDM). However, this is actually untrue in a fair manner. In the previous papers, the OOBE levels of these two schemes have been compared under the assumption of the same number of subcarriers. But such an assumption is very unfair!

Obviously, the total number of subcarriers of OFDM system (denoted by 'K') is determined by considering the coherence time and bandwidth expected. Therefore, under the same (or similar) circumstances, it is fair to set the number of samples in the GFDM symbols to be equal to 'K', which means that MN=K (M: number of subsymbols in GFDM system, N: number of subcarriers in GFDM system). In short, comparing the OOBE levels under the condition of K=N is quite unfair because GFDM requires the longer coherence time than OFDM in that case, and two systems have different spectral efficiencies. Instead, assuming MN=K is fair.

However, when MN=K, there is no gain of OOBE of GFDM systems compared to the OFDM one because of circular filtering, and I have already checked it up through both mathematical analysis and computer simulations.

So, I want to know what benefits we can get from the use of GFDM. As I know, the improved PAPR performance can be expected. But I'm not sure it is meaningful because of high implementation complexity of GFDM transceiver. In my opinion, the OFDM with PAPR reduction techniques may be preferable.

How do you think about it? Am I missing something? If it is, can you please let me know what benefits we can obtain from GFDM?

Thank in advance


texts:
I am doing the Communications course, in that for one of the problems, they have given

Uplink Eb/No
coding gain of code rate (Convolutional coding)
datarate
minimum BER Bandwidth

I need to find

downlink Eb/No and overall Eb/No

In order to reduce BER, we have to add coding gain to Eb/No

To calculate downlink Eb/No, we were asked to use

((uplink Eb/No *
downlink Eb/No) / (uplink Eb/No + downlink Eb/No)),
suppose, For example, 33 is the uplink Eb/No, then applying the above experssion, I should be arriving at
(33 * downlink Eb/No) / (33 + downlink Eb/No))
33 + downlink Eb/No = 33 * downlink Eb/No
33 = 33 downlink Eb/No - downlink Eb/No = 32 downlink Eb/No
downlink Eb/No = 33/32 ------ Point 1. Is this downlink calculation right.
Secondly, we were told, to reduce BER, we need to add coding gain to the Eb/No.
overall Eb/No = ((uplink Eb/No *
downlink Eb/No) / (uplink Eb/No + downlink Eb/No))
So,
Is it that the uplink Eb/No should be used as such (without adding coding gain) in the overall Eb/No formula and add the coding gain to the overall Eb/No found after finding the downlink Eb/No.  Here both uplink & downlink Eb/No would be used without adding coding gain but the coding gain would be added to final Eb/No.

Or should the coding gain be added to the uplink Eb/No and find downlink Eb/No. Add coding gain to the calculated downlink Eb/No. Use uplink & downlink Eb/No (with added coding gain) to calculate overall Eb/No (without adding coding gain to overall Eb/No as coding gain is added to the uplink & downlink Eb/No)

Or with #2, after finding overall Eb/No (with uplink & downlink Eb/No with coding gain added to each) through eq 9-28, add coding gain to overall Eb/No as well?

Can someone help me with this questions please?


texts: If a have a causal IIR filter described by $H(z)$ and I sample it in $N$ equispaced values around the unit circle, I get a DFT of $N$ points. That DFT corresponds to $h[n]$ truncated in $n=N-1$ or to the DFT of $h[n]$ periodized with period $N$ (i.e. with copies of itself overlapped every $N$ points)?


texts:
I'm a student and I have been assigned to make a presenation on algorithms to prevent audio feedback loop (microphone feedback, that issue when you hear the voice echoed multiple times).
I looked online but I can't find any specific algoritm name that is used to achive this. I just need a name I can look online for books, whitepapers for that algorithm.
Thank you!


texts: How to show that the signal $x_n = A\cos(\omega n)$ can be fully predicted by a system with two weights $w_1,w_2$

texts:
I am trying to solve the following exercise:

  Show that the signal $x_n = A\cos(\omega n)$ can be fully predicted by a system with two weights $w_1,w_2$ (i.e. $x_n = w_1 x_{n-1} + w_2 x_{n-2}$). Find $w_1,w_2$.

Some ideas came up but, even if they are right, I can't seem to order them in the right direction:

I can see that $x'' = -\omega^2x$. Does it connected somehow to what is asked?
I guess it has something to do with stationary signals. If yes, how can I prove that this signal is stationary? (Also, somehow I can't find in the internet a clear definition of "stationary signal". Just vague ideas like "not dependant on time". What does this mean mathematically for a signal to be "not dependant on time"?)
Maybe it is concerned with some trigonometry of this form:
\begin{align} x_{n+2} &= A\cos((n+2)\omega) \\ &= A\cos(n\omega + 2\omega) \\ &= A\cos(n\omega)\cos(2\omega) - A\sin(n\omega)\sin(2\omega) \\ &= B\cos(n\omega) + C\sin(n\omega)\end{align}
I could go on with this development but I am realy not sure what am I looking for..

Any help?
Thanks!


texts: DWT initialization from nonuniform samples

texts:
Let $D\subset\mathbb R$ be compact, let $f:\mathbb R\to\mathbb R$ be a contintinuous function with support $D$.

Let $\phi(x)$ be a well-defined scaling function, in the sense that it generates a standard MRA $\{V_j\}$.

Define the orthonormal functions $\phi_{jk} := 2^{j/2}\phi(2^j x-k)$, then we have that the approximation $f_J$ of $f$ at a scale $J$ is in $\overline{\text{span}}\left\{\phi_{Jk}\right\}_{k\in K}$ being $K$ a suitable subset of $\mathbb Z$ such that $\cup_{k\in K} supp(\phi_{Jk})$ covers $D$.

As a consequence there exist a family of coefficients $\{a_k\}_{k\in K}$ such that
$$
f_J = \sum_{k\in K} a_k\phi_{J k}
$$
and they have the expression
$$
a_{k} = \langle f,\phi_{Jk}\rangle = \int_{\mathbb R}f(x)\phi_{Jk}(x) dx \text{ .}
$$

My question is:

assume I have a sequence of samples $\{(f_i,x_i)\}_{i\in \mathbb N}$ in $\mathbb R ^2$ such that $f_i = f(x_i)$ and assume that no regularity is given on how the samples are taken (non uniform sampling), how can I compute an estimate of $a_{k}$?

Which conditions are sufficient and necessary for reconstruction?


texts: Do I need to worry about synchronization in a digital signal processor?

texts:
I understand that a digital signal processor consist of multiple MAD (muliply add units), which execute in parallel to implement a difference equation, like this one:

$$ y[n]=10y[n-1] + 45y[n-2] + 45y[n-4]+ 67x[n]$$

and this one;

$$ y[n]=10x[n-1] + 45x[n-2] + 45x[n-4]+ 67x[n]$$

My question is do I need to be careful about synchronization as we do when programming a multicore CPU/GPU and FPGA?
If not why?


texts:
I have been recording sound sample from mouse vocalisations and noticed that a background noise appeared in the recording room. the noise is clearly visible in the spectrograms of the recordings as horizontal lines at frequencies 20, 40, 60, 80, and 100 kHz (ultrasonic range). I have tried to record in an acoustically isolated box, lined with sound absorbing material, and it helps, however, the box retains unwanted odours which effect the behaviour of the mice, rendering it unusable.

My question is if there is a method to isolate and remove the noise without affecting the rest of the sounds. I want to study the vocalisations, with an emphasis on the frequency in which the mice communicate under different social encounters, and having that constant noise in the background may affect the results of the study.

Vocal communications were recorded using a 1/4 inch microphone, connected to a preamplifier and an amplifier (Bruel & Kjaer) from mice. Vocalisations were sampled at 250 kHz with a CED Micro 1401-3 (Cambridge Electronic Design Limited, Sunnyvale, CA).

The samples were recorded using spike2, a "DC removal" filter was added to the recording. the files were then transferred to Matlab for splicing further analyses.

I know that there is a strict policy here against attaching files to questions, therefor I'm adding a link to the audio sample and the spectrogram

link to an audio sample and a spectrogram via google drive.


texts: finding the fundamental frequency in frequency domain

texts:
I want to get the fundamental frequency of a signal. I used a time domain approach first. It just sums up the differences between the signal (lets say 2048 samples) and the delayed version of the same signal. I think it's not quite what autocorrelation does because I don't pad the signal with zeros or do circular convolution. Instead, I just accessed older samples. So when compairing the signals with 1 sample delay, I check samples 1 to 2048, for a 5 sample delay I check samples 5 to 2053 and so on. For the full 2048 sample delay, I check 2048 to 4096.
This works our really well because I just need the delay where the difference is the lowest. That might not be the fundamental but haveing a closer match is more important for my actual usecase. (writing an oscilloscope)

I ran into performance issues, so I wanted to use FFT instead of the time domain approach. However, I've noticed that because of the zero padding of the signa, I get some kind of triangle window. I guess what would be the equivalent in the time domain approach is using zeros instead of older samples in the delayed signal. (I've attached a screen from Matlab)

My question is if there is some way to use FFT for processing but to get rid of this "triangle window" effect. Or in other words: Is there a way to implement my time domain approach using FFT?

Cheers


texts: Calculating Energy Spectral Density from Magnitude and Phase data

texts:
I'm trying to do a program that can judge whether 2 audio files have the same pronunciation or not by comparing the frequency of them with each other.

The first step, finding the magnitude and phase data from the audio file by using Discrete Fourier Transform, is done. I now have a list of the DFT data from both files in 2 arrays with 10k data points in each.

My question is from that, how do I calculate the energy spectral density? What I plan to do next is to compute the Mean Squared Error of the energy spectral density between the 2 voice's data, and the result will be put under a threshold to see whether those 2 files are similar or not.


texts: Normalizing vectors to be the same size to retain PSD data

texts:
Context:
PSD=periodogram(y) in MATLAB gives the PSD (power spectral density) estimate of a sound-source signal. I want to find the local maximum within 3 different x ranges of PSD.

How do I make a vector that maps 1:1 to the PSD -y value vector?
The x values that MATLAB generates are Hz - frequency values, so I don't want to change the values per se, but create a vector that goes from x=0:3500, but have the same number of elements as the PSD vector, PSD= 32769*1 double.

How do I do this while retaining the same data?
    PSD plot. acquired with plot(PSD) <-- x values generated by MATLAB

  [1]: https://i.stack.imgur.com/PiYGB.png

    %% formantdaddy will try to do all the steps of the process
% 1. grab sound from folder
% 2. get PSD = Power Spectral Density
% 3. look for local maxima within prefined ranges
    % 200 - 800 Hz
    % 800 - 1800 Hz
    % 1800 - 3500 Hz
%store data into a struct

clear all;
close all;
clc;
%% audioread .wav file
[y Fs]= audioread('100-daddy1.wav');
%% y=source signal
sourceFig=figure(1);
plot(y);
xlabel('milliseconds'); ylabel('amplitude'); title('spectrogram = voice source signal');

%% PSD - Power Spectral Density <-- peaks here should give formants
filterfcn=figure(2);
PSD=periodogram(y); %calculate the power spectral density of the source signal
plot(PSD);
ylabel('magnitude || intensity of signal'); xlabel('frequency in Hz'); title('PSD of Source');
xlim([0, .35*10^4]);
%% F1 range
subset1=zeros(1, 601); %create a vector to store PSD values within the range of interest
for x=200:800;
    subset1(x)=PSD(x);% input in the values of interest
end

for x=200:800;
    Y_max=max(subset1);
    F1=x;
end
disp(F1);
disp(Y_max);
% find the max value within the range
%PROBLEM: wanted to find the x value which corresponded to the max y <-- but this actually is the max y value
%PROBLEM: x vector not the same size as PSD values within the range, so many points not considered.

%% F2 range
subset2=zeros(1, 1001);
for x=800:1800;
    subset2(x)=PSD(x);
end

for x=800:1800;
    Y2_max=max(subset2);
    F2=x;
end
disp(F2);
disp(Y2_max);
%% F3 range
subset3=zeros(1, 1701);
for x=1800:3500;
    subset3(x)=PSD(x);
end
for x=1800:3500;
    Y3_max=max(subset2);
    F3=x;
end
disp(F3);
disp(Y3_max);
%% store values into a struct
Ftable=struct("FileName", "100-daddy1.wav", "F1_Hz", F1, "F2_Hz", F2, "F3_Hz", F3);


texts: Type of filter, given difference equation?

texts:
Given a difference equation, how do we tell if it is an IIR filter or FIR filter?
For example,

y(n) = x(n-3)+y(n-1) . Is it FIR or IIR? Can you please give me a way to figure this out?
Thanks! :)


texts: How to iplement fast DCT-III (for inverse of DCT-II) using FFT or iFFT

texts:
I have to implement DCT-II and its inverse which is equivalently given by a forward DCT-III. All from real to real.

I have been checking some paper where it is specified how to do it. However, I already have kissfft as a dependency so I can use FFT and iFFT. I have implemented DCT-II using FFT and an extra space of 4N. I found three different ways to do it here.

For DCT-III, I wounder if I can do the inverse in a clever way (as in the last link) or if I have to implement it using the formula.


texts: How to remove echo/reflected-sound caused by stationary objects when building a ultrasound based radar

texts:
I am emitting ultrasound with a speaker and am trying to track moving objects with a microphone array by detecting doppler shifts. I have succeeded to detect movement. However, to detect the direction of the movement, I found that I need to cancel the sounds reflected from the stationary objects. The goal is similar to MTI filters in aircraft radars which used for clutter filtering.

Consider input signal 1 (Sig1 for short) caused by movements (i.e., contains doppler shift) and input signal 2 (Sig2 for short) reflected from stationary objects. I have first simply tried subtracting the frequency spectra of Sig1 with Sig2 but did not work well. Furthermore, I tried to simply filter the non-doppler shift related frequencies by setting them to zero. This removes reflected sounds to a certain degree but still contains reflected sounds sources. Is there a robust way I can make use of?

I am relatively new to this area. Thank you for your help in advance.


texts: Demonstrate the mean of the sample variance

texts:
Let's suposse I have a vector of elements $x(n) = \{x(0), x(2), \cdots ,x(N-1)\}$ from a random process X of mean $\mu_x$ and variance $\sigma_x^2$. I want to see if I can estimate the mean and variance of the random process with my finite vector.

So, we say an estimator is unbiased if the mean of the estimator is the same as the mean of the random process. For example, the sample average is:

$$\hat{\mu}_x = \dfrac{1}{N} \sum_{n = 0}^{N-1} x(n)$$

Taking average in each member:

$$E[\hat{\mu}_x] = \dfrac{1}{N} \sum_{n = 0}^{N-1} E[x(n)] = \dfrac{1}{N} \sum_{n = 0}^{N-1} \mu_x = \mu_x$$

Thus, the sample mean is unbiased.
My problem comes with the mean of the sample variance. The definition of the sample variance is the following:

$$\widehat{\sigma_x^2} = \dfrac{1}{N} \sum_{n = 0}^{N-1} (x(n) - \hat{\mu}_x)^2 $$

I have to prove that:

$$E\left[\widehat{\sigma_x^2}\right] = \sigma_x^2 \left(1 - \dfrac{1}{N} \right) $$

I have tried to expand the square parenthesis:

$$\widehat{\sigma_x^2} = \dfrac{1}{N} \sum_{n = 0}^{N-1} E[x^2(n)] + E[\hat{\mu}_x^2] - 2 E[x(n) \hat{\mu}_x]$$

Nevertheless, when I have to calculate $E[\hat{\mu}_x^2]$ (I suppose it's this way):

$$E[\hat{\mu}_x^2] = \dfrac{1}{N^2} E\left[ \left( \sum_{n = 0}^{N-1}x(n) \right)^2 \right]$$

I don't know how to do it. Moreover, I don't know if $E[x(n) \hat{\mu}_x] = E[x(n)] E[\hat{\mu}_x]$ (I think that's not correct in general), and I have tried to solve it in another way, but anything comes to my mind.

I hope someone can help me. Thank you for your responses.


texts: Discrete-time signals increase in frequency and period

texts:
I am studying Discrete-Time Signal Processing by Alan V. Oppenheim and Ronald W. Schafer. I am confused when it says

periodic discrete signal oscillates more rapidly when its frequency is increased from $0$ to $\pi$

and

frequencies in the vicinity of $\pi$ are referred to as high frequencies

But I don't think it's monotonically increasing, for example, $\omega_0 = 999\pi/1000$ has a way longer period than $\omega_0 = \pi/2$.


texts: Is there a method to calculate the maximum gain of a biquad?

texts:
Given an IIR expressed as a biquad:

$$
H(z) = {b_0 + b_1 z^{-1} + b_2 z^{-2} \over 1 + a_1 z^{-1} + a_2 z^{-2}}
$$

Is there a way to calculate the maximum gain the biquad attains over the range $0$ and $\pi$?

One way is to calculate the turning points of $H(z) \bar H(z)$ and plug those back into $H(z) \bar H(z)$ but that would result in a horrible equation to solve in large powers of $z$ (probably up to order $7$) or differentiation by parts of a quotient based on terms of $\cos$ (depending on the two ways to tackle $H(z) \bar H(z) $).

Has this problem been simplified down to a ready made formula? Or is there an easier way?


texts: Convolving complex exponential with box function (discrete)

texts:
If I have $$x[n] = u[n] - u[n-4]$$ where $u[n]$ is the unit step function, and $$h[n] = e^{-i\frac{\pi}{2}n}$$

does $x[n] * h[n] = 0$?

I tried doing the convolution sum and I got: $1 - i - 1 + i = 0$ and I also just tried plotting points and think I got 0 also, but I'm not sure if I did either of these correctly. Is there any easier or intuitive way to think about convolving a discrete complex exponential with a function, or (if it's easier the other way around), convolving a discrete box with another function?


texts: Band-edge timing error detector, time accumulator

texts:
im trying to implement a band-edge FLL and timing locked loop from this paper (https://www.researchgate.net/publication/261499267_Band_edge_filters_perform_non_data-aided_carrier_and_timing_synchronization_of_software_defined_radio_QAM_receivers).
The FLL works fine but i didnt understand the time accumulator and the interpolator.
Usually the interpolator would decimate the signal to 1 smpl/sym.
In this application it is just a variable delay filter?
How do i pick the optimal sample afterwards?


texts:
Theory

Suppose an OFDM transmitter with four subcarriers is implemented using the structure shown below.

If the serial data input rate is 40 bps, each parallel stream will run at 10 bps. Theoretically, the spectrum (assuming BPSK modulation for each subcarrier) of the IFFT output $x$ should look like shown below (the subcarrier carrier frequencies were chosen arbitrarily).

Each channel occupies a bandwidth from -10 Hz to +10 Hz around the subcarrier, resulting in a total OFDM null-to-null bandwidth of 50 Hz, as shown in the spectrum above.

Simulation results

However, the simulated spectrum of the IFFT output $x$ is shown below. Each input bit is represented by one sample (there is no reason to use more samples before the DAC).

One difference between the theoretical and simulated spectra is the difference in bandwidth. The theoretical spectrum has a bandwidth of 50 Hz, whereas the simulated spectrum has a bandwidth of 40 Hz. This can be explained by setting all IFFT inputs to zero, except one, and calculating the resulting spectrum. This process can then be repeated for each of the parallel inputs numbered 0 to 3 in the transmitter structure above. The four spectra are shown below.

Clearly, each parallel stream contributes a bandwidth of 20 Hz, spaced at 10 Hz. This corresponds to the theoretical BPSK OFDM spectrum, except that stream 2 is located at 20 Hz which mirrors back to -20 Hz, with the result that the total bandwidth is 40 Hz and not 50 Hz.

DAC output

In order to transmit the OFDM signal on a carrier, more samples are required per IFFT output value. The DAC should therefore employ a sample-and-hold strategy, of which the simplest is probably just repeating every IFFT output value $K$ times. The spectrum of the sample-and-hold signal $x_r$ with $K=8$ is shown below.

The bandwidth has now increased to 80 Hz, which can again be explained by looking at the individual contributions of each of the parallel streams, shown below.

The spectrum between -20 Hz and 20 Hz in each of the subfigures above corresponds to each respective stream shown in the OFDM streams (before resampling) figure. The harmonics caused by resampling however cause the bandwidth to increase from 40 to 80 Hz.

Question

What should the bandwidth of the BPSK OFDM signal be after resampling? Is it 50 Hz (according to theoretical graph shown), 40 Hz (simulated before resampling) or 80 Hz?

Should a filter be used to achieve the correct bandwidth?
How is OFDM typically implemented to ensure the correct bandwidth; should some subcarriers be set to zero? Should another DAC approach be used?


texts:
I am perfectly aware that you can efficiently use the standard FFT Cooley Tuckey algorithm to process N samples with one complex N/2 sized FFT. This however requires one additional loop before the FFT to "prepare" the data and one after to rearrange them.
I am rather wondering whether a natively real FFT implementation existed, working on a sequence of N samples directly and returning a half complex spectrum directly i.e N/2+1 bins (which still sums to N floats since DC and Nyquist have null imaginaries). Does such a natively real FFT algorithm exist ?
Standing to my experiments and calculations  it can be done in theory, since it is still about recursively split data in half, computing the FFT and combine, but the actual implementation if one wants to keep efficiency high and avoid recursion and copy operations can be very hard and puzzling, that's why I asked whether there was something similar already. Thanks


texts: Does anyone know the name of the first DSP (sampled data) practitioner who discovered that real-valued symmetrical-coefficient FIR filters exhibit linear phase in the frequency domain?


texts: How can convolution be a linear and invariant operation?

texts:
I'm having a slight breakdown right now with a seemingly simple question. Say I have a system that convolves an input function with itself to produce an output function:
$g(x) = f(x) ∗ f(x)$
I've heard countless times that convolution is a linear operation and just assumed it was fact. However, I'm trying to understand how this is possible.
In my system above, it doesn't seem like this system could be linear since convolution contains multiplication. So multiplying an input signal with itself can't possibly be linear. However, it would appear to be shift invariant.
Am I correct in my logic? I seem to have a misunderstanding of convolution being a linear operation.


texts: Initial Clock synchronization between multiple smart phones (android OS) connected over Wifi?

texts:
I want to synchronize the initial clock of multiple smartphone devices (Android-based) for real-time VoIP communication. Basically, a MANET has been formed and I want to synchronize the clocks up to  5ms difference in MANET.

So far using Ultrasonic chirp, I have been able to synchronize the initial clock with up to 100ms of difference.

What approaches should I follow to get the desired difference?

I have read many research papers I cant use NTP for time-sync and I came to know about PTP about which I am unable to find any algorithm to implement in MANETS.


texts: What does Smoothness Prior mean in the context of image processing?

texts:
I can quote from an article:

  "The first category of methods, known as diffusion-based inpainting,
  introduces smoothness priors via parametric models or partial
  differential equations (PDE) to propagate or diffuse local structures
  from the exterior to the interior of the hole."

What is Smoothness Prior?

What does this definition mean?


texts: Suppose we have a communication channel that has a bit-error rate of 50% and the bits are flipped at random such that the receiver has no efficient way to tell which bits have been flipped and there are no error correction bits transmitted with the signal. How do you calculate the information loss (in bits) imposed by the channel? I know there a Shannon formula for doing this but I don't know what it is! Could someone solve this for me with a specific example? Thank you.


texts: Sample Rate: How to determine sample rate

texts:
I have this ADC and I have this 169p micro-controller. The system oscillator clock frequency (FOSC) is 8 MHz.

According to the ADC documentation the conversion process takes 16 cycles. So if I have FOSC of 8MHz would I get a sampling rate of 8000000/16 = 500,000 samples per second? The ADC has 4 channels so can I divide the sample rate by 4? 500000/4 = 125,000 samples each 16 bits (2 leading zeros, 2 for channel, 12 for conversion).


texts:
Why do we use complex exponentials in the Fourier transform, why do we want the phase part? As opposed to in DCT where there is no phase and only magnitude?

Moreover, what does this phase concretely mean for the signal reconstruction/decomposition? (I know it is related to a shift of a signal, i.e. i know that sin and cos are phase shifted by pi/2 rad u.e. 90 degrees but i can t really make sense of it in Fourier?


texts: Can I sample at Nyquist rate if I know that my samples are taken only at the signal's maxima or minima?

texts:
I know that in general the sampling rate, $f_s$, must be greater than twice the highest frequency of the signal, $f$.
If I sample at the Nyquist rate, it can lead to the following:

However, if the signal is sampled only at maxima and minima, then we get this:

My signal is not pure sinusoidal, it is something like this:

Will I loose any frequency components if I sample it at the Nyquist rate?


texts:
I have to process a RF signal band with bandwith between 75MHz and 100MHz to divide it in up to 8 contiguous subbands, each one with a bandwith programmable between 50kHz and 25MHz, in 25kHz steps.

The objective is to have the capability to attenuate each sub-band differently.

Transition skirts should be aprox. 6dB at 25kHz, on-band ripple less than 0.5dB and out-of-band attenuation better than -85dB at > 500kHz of the transition frequencies.
I would prefer a linear phase filter to ensure a constant group delay (constant, but as low as possible).

My first thoughts were to downconvert the RF signal band to a lower band (or to 0Hz to create a complex I+Q signal), then use 8 separate FIR filters, and finally upconvert the summing result.
However, I guess that the contiguity between adjacent filters may lead to some ways to reduce the computation cost.
May you give me some suggestions?


texts: System response: LTI system for $x[n] = \sin(\frac{\pi n}{4})$

texts:
Consider the LTI system with frequency response
$$H(e^{j\omega}) = \frac{1-e^{-j2\omega}}{1+\frac{1}{2}e^{-j4 \omega}}, -\pi < \omega < \pi$$
Determine the output $y[n]$ for all $n$ if the input $x[n]$ for all $n$ is
$$x[n] = \sin \left(\frac{\pi n}{4}\right)$$

My attempt: $x[n]$ is an eigenfunction of the LTI system, so the output have the form
$$y[n]=|H(e^{j \omega})|\sin\left(\frac{\pi n}{4} + arg(H(e^{j \omega})\right)$$
But I dont know how to determine the phase and modulus of the frequency response with this form. For example, I think that
$$| 1 - e^{-j 2 \omega} | = \sqrt{(1-\cos(2 \omega))^2 + \sin^2(2 \omega)}$$
Analogous, doing for the denominator, I could not simplificate the result.

The answer:

$$y[n]=2 \sqrt{2} \sin \left( \frac{\pi(n+1)}{4} \right) $$


texts: How to determine poles and zeros of the z-transform?

texts:
This is a simple question, but I just don't understand how we determine the poles and zeros of a rational system function.

For example, for the LTI system described by this constant coefficient difference equation
$$
y[n]-\frac{5}{2}y[n-1]+y[n-2]=x[n]
$$
we can determine that

$$
H(z)=\frac{1}{(1-\frac{1}{2}z^{-1})(1-2z^{-1})}
$$

I understand why there are poles at $z=\frac{1}{2}$ and $z=2$, but I don't understand why there are two zeros at $z=0$. Even if I multiply $H(z)$ through by $z$, there would only be one zero, correct?


texts: Fractional Bandwidth of a Gaussian Amplitude Modulated Signal

texts:
a gaussian modulated sinusoidal signal may be expressed as
$$x(t)=A\cdot e^{(j2\pi ft)}\cdot e^{\left[-\frac{1}{2\sigma^{2}}\cdot(t-t_{0})^{2}\right]}$$
Let's consider the case in which the gaussian peak is at 0 and the total amplitude is 1:
$$x(t)=e^{(j2\pi ft)}\cdot e^{\left[-\frac{1}{2\sigma^{2}}\cdot t^{2}\right]}$$

What is the fractional bandwidth of this function?
I'm asking this question since I think it's a quite used parameter. In fact, there are a proper function of MATLAB and a proper function of Python) which can generate this function, and both ask me to specify:

the sine wave frequency (which is $f$);

the signal fractional bandwidth

I think the last one is necessarily linked to the standard deviation $\sigma$. But by which mathematical relationship? It's a bandwidth in time domain (so the FWHM of the gaussian pulse: $2.35\cdot \sigma$) or the bandwidth in frequency domain (so ???)?


texts: How to design a lowpass filter using Hamming window and sinc function

texts:
I have these three equations and have a noisy voice signal. I have to design a low pass filter of length N=1000 using hamming window technique. I have selected its cutoff frequecny 0.25 (normalized).
\begin{eqnarray}
h_{id}[n] &=& \frac{\sin{(2\pi f_c (n - \frac{N-1}{2}))}}{\pi (n - \frac{N-1}{2})},\ 0\le n  \le N-1 \\
  w[n] &=& 0.54-0.46\cos{(\frac{2\pi n}{N})} ,\ 0\le n \le N \\
 h_F[n] &=& h_{id}[n]\cdot w[n] \\
\end{eqnarray}
Now the problems that I am facing are: if I follow the equations, the dimensions of both $h_{id}[n]$ and $w[n]$ becomes unequal and I cannot multiply them to get the finite length impulse responce of sinc function; also as I am a newbie I really do not know how to apply this filter to the voice signal.

Note: According to the instructions from the Professor, I can not use any built-in function or commands except the "filter" command

Any help would be appreciated.

The Matlab code:

clc; clear all;  close all

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

N = 1000;
n = 0:N-1;
new_n = 0:N;
fc = 0.3;
temp_N = (N-1)/2;

h_id = sin(2*pi*fc *(n - temp_N))./(pi *(n - temp_N));
figure('Name','Voice Signal in Time Domain','NumberTitle','off');
subplot(2,1,1)
plot(n,h_id)
title('Continous Time Plot (not true: as we have a DT signal, it is just for understandings)')
xlabel('Time \rightarrow')
ylabel('Magnitude \rightarrow')
axis([450 550 -0.2 0.7])
subplot(2,1,2)
stem(n,h_id)
title('Discrete Time Plot')
xlabel('Samples \rightarrow')
ylabel('Magnitude \rightarrow')
axis([450 550 -0.2 0.7])

w = 0.54 - 0.46*cos((2*pi*new_n)/N);
h_F = h_id .* w;
freqz(h_F)

fileName = 'D:\Studies\Semester#6\Digital Signal Processing\Assignments\Assignment 2\VOICE.wav';

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[y, fs] = audioread(fileName);
N_FFT = length(y);
time = (1/fs) * N_FFT;
t = linspace(0, time, N_FFT);
figure('Name','Voice Signal in Time Domain','NumberTitle','off');
plot(t,y);
title('Time Domain plot of the Voice Signal')
xlabel('Time \rightarrow')
ylabel('Magnitude \rightarrow')

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

playerObj = audioplayer(y, fs);
play(playerObj);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

signalFFT = fft(y);
figure('Name','Voice Signal in Frequency Domain','NumberTitle','off');
subplot(2,1,1)
xaxis = (0:N_FFT-1)/N_FFT;
plot(xaxis, abs(signalFFT));
title('Frequency Domain Plot of the Voice signal (without shifting[fftshift])')
xlabel('Normalized Frequency \rightarrow')
ylabel('Magnitude \rightarrow')
subplot(2,1,2)
plot(xaxis, fftshift(abs(signalFFT)));
title('Frequency Domain Plot of the Voice signal (with shifting[fftshift])')
xlabel('Normalized Frequency \rightarrow')
ylabel('Magnitude \rightarrow')


texts: MACE correlation filter - any suggested values of of u?

texts:
I am trying to understand the MACE correlation filter as per the paper

  Mahalanobis, A., Kumar, B.V.K.V., Casasent, D.: Minimum average correlation
  energy ﬁlters. Appl. Opt. 26, 3630–3633 (1987)

The equation to train the MACE filter is this

I however am abit confused about what values you use for u.  From my reading u, is an N x 1 vector containing the desired peak values for the training images.  Is this something I would just set to 1, could someone offer some suggested values

I have found a basic implementation in matlab from here (code posted below) but it does not give any definition to how I would go about deciding what u is?

D = diag(mean(abs(X),2));
% inv(A) * B = A \ B
XDX = ctranspose(X) * (D \ X);
h = (D \ X) * (XDX \ u);
H = reshape(h, size(I));

I will appreciate any help with this.

Thanks


texts: Doopler spread and delay spread in an equation of channel freq response

texts:
Assumed the transmission system with  channel  impulse response is determined by the matrices $H(\tau_l) \in C^{N_R \times N_T}$ ( $N_R$ and $N_T$ are numbers of received and transmit antennas)
By taking the Fourier Transform (FT) of the impulse response, we get the frequency response of the channel at subcarrier $n$.
\begin{equation}
H(n)=\sum_{l=1}^{L} H(\tau_l) \cdot e^{i \cdot 2 \pi (f_c+\Delta f \cdot n)\tau_l},
\end{equation}
where $f_c$ is the centre frequency, $\Delta f$ is the subcarrier  bandwidth, $n$ is a subcarrier index, $n=1, \ldots N$.$t$ denote time, $\tau$ is delay. $\tau_l$ is the cluster delays.
How should I change the equation above if I need to check how the doppler delay is affected system?


texts: How do I convert a timeseries to a different frequency band?

texts:
I have a real time series sampled at 32 MHz. So, when I channelized it and plot it against time, I get a Frequency vs. Time image plot where the frequency domain spans 16 MHz. To elaborate, this basically entails taking, say, 2048-sample chunks of data and doing a Fourier Transform on each to get a 1024-channel '16 MHz'-wide Fourier Transform over time (because we only care about positive frequencies). It looks something like this:

Every vertical line in that plot is a Fourier Transform of 1024 channels. Which means that the time step between adjacent vertical lines is 2048 samples wide or 64 microseconds wide.

Now, what I want to do is convert this time series so that it looks like it was sampled at 48000 Hz, but not actually. Basically, I want the 16 Mhz frequency channel to correspond to a 24 kHz channel. So, I still want to preserve the structure of the data. So, a naive low-pass filter doesn't work, because I don't actually want to remove the higher frequencies, I just want to "redshift" it all. I want to go from a 0 - 16 MHz band to a 0 - 48 kHz band. But those pulses that pulse at 4 Hz, I still want them to pulse at 4 Hz.

The way I would try to do this, is by binning the channels. So, if I have 1024 channels (as from above) - I'd try to bin them into, say, 32 channels (and compress the spectrum by 32 times) - which basically means that I would take blocks of 32 channels and sum them or average them somehow to get one channel. Now, I really want to compress this spectrum 666 times but it doesn't matter. I really just need to understand how to meaningfully combine multiple Fourier Transforms into one.

Unfortunately, the only way I know how to do this is by taking the amplitude of the Fourier Transforms and then summing up adjacent channels to bin the channels. But this LOSES phase information - and I lose the pulses that I want to survive. So, how do I those these channels into a bin meaningful without losing both phase or amplitude information?

More concisely, my question is the following:

  Given N Fourier Transforms of N real functions, is there a meaningful
  way to get a sum of them without losing phase and amplitude
  information?

Of course, this doesn't have to be the question if someone knows a better way to handle my overall problem without binning channels.