texts:
I am confusing when I find the lpc roots magnitude, f1=0.9313, f2=0.9308, f3=0.91 and f4=0.95 but when I look at LPC envelope the f1 is higher than f4 in term of magnitude in dB.
Could anybody explain it ?

I have wrote following MATLAB code :

frame=wave((i-1)*frame_length+1:(i*frame_length));
a=lpc(frame,30);
r=roots(a);
r=r(imag(r)>0.01);           % only look for roots >0Hz up to fs/2
for k=1:length(r)
z(k) = abs(r(k));
ffreq(k)=(atan2(imag(r(k)),real(r(k)))*fs/(2*pi));% convert to Hz and sort
end
[ff,index]=sort(ffreq);
fprintf('\n Start of frame %d \n ',i);
for j=1:length(ff)
fprintf('Formant %d Frequency %.1f --- %.2f\n',j,ff(j),z(index(j)));
end
fprintf('\n End of frame %d \n ',i);


texts: ifft of signal without phase information

texts:
I have a chemical spectrum with amplitude on the Y axis and wavenumbers on the X axis, sampling interval I think this is $1.5^{10}$ hertz. I would like to reconstruct the amplitude/time representation of the original signal by performing a ifft of the signal however I have no phase information. Since the information is unchanging (constant) over time I don't think that the phase information is necessary for reconstruction of the original signal. Can I set the phase information to zero and still reconstruct the signal in this case and how do I incorporate the sampling interval in the matlab ifft routine for accurate frequency calculation?

This is what I think I should be using

sig = abs(ifftshift(ifft(complex(data.YData))));

Thanks

Dave


texts: Can you explain how to imagine frequency in 2D? I need to understand how the concept of frequency exists in images

texts:
The concept of frequency spectrum exists because it is possible to sum sines and cosines of various frequencies together to make any periodic signal. The frequencies of these individual sinusoids make up the spectrum of the final signal. Now when it comes to image processing we treat image as a signal similar to sound for example in that it has a bandwidth and it is possible to filter certain frequencies it to achieve various results.

What I am not clear about is, how did people get concept of frequency in 2D? Sinusiods are 1D signals, how can we extend this concept of frequency into 2D? Is it possible to do the same in 3D and do filtering in 3D? Does anyone do that in any application?

I fully understand low pass, high pass, band pass and band stop filters. Their frequency respons curves are quite straight forward. What I do not understand is, how is this extended into 2D?


texts: Equivalence of Maximum Likelihood (ML) and Discrete Fourier Transfrom (DFT) Peak Finding for Single Tone Estimation

texts:
My understanding is Maximum Likelihood and DFT Peak Finding for a single tone produce the same results assuming the ML is restricted to the same frequencies as the DFT.

I was wondering if there was an easy way to prove this?
My understanding is that ML will be the same doing Least Squares regression so I suppose an equivalent statement would be to prove that the DFT peak gives the best Least Squares estimate of single tone sinusoidal.


texts: How to characterize the randomness of an event using it's PSD?

texts:
I have the power spectral density function of a stochastic phenomenon.

how can I generate a signal (time series) representing the randomness of this event over time?
How can I draw the probability distribution and commutative distribution functions from the given PSD in order to take N samples using the basic monte Carlo method?

The answer of (2) can be used to model the uncertainty of an event to use in Stochastic programming. We should get N samples, with an equal probability of 1/N.
The answer to (1) can be used to evaluate the given results of the stochastic programming by out-of-sample analysis.
Since I am not so familiar with Signal Processing notations, it would better to have the answer in form of an algorithm or Matlab/Python code, if possible.


texts: How to Remove the Patch Artifacts of Neural Network Denoising Process?

texts:
I have written a python script which uses the Noise2Noise: Learning Image Restoration without Clean Data implementation of the Auto Encoder which is useful to remove noise from images. In the original paper implementation they were using full images so there were no border artifacts.

I want to use my script on raw images from long exposures and high ISO to remove the noise. For this purpose, I fragment the image into small fractions which are run through the Auto Encoder network. After prediction, original image is reconstructed. However, the problem is with the border connections between slices (As showed in the images below). Do you have any suggestions what would be the best idea to "fix" it? I would be more than grateful!


texts:
I want to evaluate the Fourier series expansion of $ x_1(t) = \sum _{-\infty}^{\infty} \Delta (t-2n)  $, where $  \Delta (t) $ is a triangular function defined as:

I have done the following calculations so far. However, two of these six terms need to cancel. But as per my calculations, all the six terms are retained. The answer should be:

I have enclosed my solution below:

I think there's some sort of minor mistake in my solution.


texts: Is the sampling period arbitrary for a bilinear transform, and why?

texts:
I have been given the specifications for a digital highpass filter (stopband, passband, stopband attenuation and maximum passband ripple).
I am expected to design a prototype lowpass filter in the analogue domain, use frequency transformation to convert it to a highpass, then use bilinear transformation to convert it into a digital filter. I am using a Butterworth filter for prototype.
However I have not been given the sampling frequency(or period) for pre-warping. I have seen textbooks take period = 1 as it is arbitrary, however I don't understand why. Any confirmation that this is okay, and explanations will be appreciated!


texts: How to determine number of filters in filter bank based on spectrogram of audio signal?

texts:
I want to do an analysis and than synthesis of audio signal, which is audio of vowel 'a', using Matlab. For this I need to use filter bank(array of band-pass filters). I have drawn four different spectrograms for different length of Hamming window(64, 128, 256, 512). Here is the code that I'm using:
close all;
clearvars;
clc;

[x, Fs] = audioread('a.wav');
len = length(x);
figure,plot(x);

figure,subplot(221);
spectrogram(x, hamming(64), 33, 1024, Fs);
title('Hamming 64');
subplot(222);
spectrogram(x, hamming(128), 97, 1024, Fs);
title('Hamming 128');
subplot(223);
spectrogram(x, hamming(256), 225, 1024, Fs);
title('Hamming 256');
subplot(224);
spectrogram(x, hamming(512), 481, 1024, Fs);
title('Hamming 512');

and as the output I got this figure:

My task is to determine proper number of filter bank(N), based on the obtained spectrograms, to do first analysis and then synthesis of signal using the same filter bank, without losing too much information and  getting signal distortion. For realization of filter bank I will use Hamming window. I should draw conclusions only by observing spectrograms.
So does anybody know what is that number, how many filters do I need to get perfect reconstruction?


texts: Probability distribution of windowed cross-correlation

texts:
This question is in the context of time-delay estimation. Say I have a stationary Gaussian stochastic process $g$, and I know its autocorrelation function $R_g(\tau)$. To do time-delay estimation, I'm computing a windowed cross correlation between $g$ and a delayed version of it. In other words,
$$
g_1 = g(x-D) \\
\phi(\tau) = \int_{-T/2}^{T/2} g(x) g_1(x + \tau)
$$
and I'm going to determine the delay by finding the maximum of $\phi$.

My question is, is it possible to get an expression for the probability distribution of $\phi$?


texts: i had some question.i have do some some filtering FFT using a matlab program.but,i need to compared the original signal,noise signal,and filtering signal based on SNR.but i dont understand how to calculate the snr ratio.pls help me or give a suggestion method how to compare and analysis the signal.tq


texts: Colorimetry: Gamma/gamut colors Color/color light

texts:
I've been reading some color basic stuff and I came across with two different terms: gamut and gamma colors. By definition the difference between them may be clear. I found:

Gamma: transfer characteristic of display
Gamut: Range of reproduced color lights

However, these definitions led me to to check these concepts:

Color light: luminance, hue, saturation
Color: Hue and saturation

After checking these last terms everything turned really complex. Could you explain to me what the difference between color and color light is and why the first one does not include the term luminance? How are they connected to gamma and gamut colors?

Thanks in advance :)


texts: What's the formula for choosing FFT sample rate and window length to make sure the frequency I want is in the center of a bin?

texts:
I don't know why I am having such a hard time with this math, but I am. I am doing phase-sensitive detection of a few sensors, which are triggered by a modulated light source. The modulation frequency f0 changes by up to several Hz over the course of the day based on ambient conditions, and is typically around 1370-1390 Hz. I'm doing an FFT to extract the sensor amplitudes at f0. With my system, I'm limited to an upper sampling rate of 10 kHz for up to 2 seconds, but no longer.

Given that I can dynamically change f0, sample rate, and window length, what is the formula for making sure that f0 is in the center of a bin?


texts: How to find transfer function by state space representation matrices

texts:
A state space representation is given by:
$$\dot{x}= \begin{bmatrix}0 & 0 & 0 & 0\\ 1 & 0 & 0 & 0 \\ 0&0&-2&-4\\0&0&1&0\end{bmatrix}x+\begin{bmatrix} 1\\0\\1\\0\end{bmatrix} u$$
$$y=\begin{bmatrix}0 & 1 & 0 & -1\end{bmatrix}x$$
I need to find a transfer function of this system. I don't know how, but I've tried it this way:

I wrote all equations:
$$\dot x_1 = u$$
$$\dot x_2 = x_1$$
$$\dot x_3 = -x_3-4x_4+u$$
$$\dot x_4=x_3$$
$$y=x_2-x_4$$

And I've draw a scheme of such system:

And then tried to find its transfer function.
$$-4X_4-2sX_4+U = X_4s^2$$
$$U = X_4(s^2+4+2s)$$
$$X_4= \frac{U}{s^2+2s+4} $$
$$X_2 = \frac{U}{s^2}$$

$$Y = X_2 - X_4 = \frac{U}{s^2} -\frac{U}{s^2+2s+4}$$
$$G(s) = \frac{Y(s)}{U(s)} = \frac{1}{s^2} -\frac{1}{s^2+2s+4}=\frac{2(s+2)}{s^2(s^2+2s+4)}$$
I don't know, whether this is right answer nor solution.

What solution would you recomend for this task? Is the solution above correct?


texts: SNR Signal to noise ratio of Pseudo random bit sequence (PRBS)

texts:
How should I estimate the Signal to noise ratio of a 20 Gbps NRZ PRBS pattern from power spectral density--where should I take the noise floor if I can assume well the noise is AWGN?
I know roughly what the spectra should look like: https://pdfserv.maximintegrated.com/en/an/AN3455.pdf
and how an oscilloscope would take the SNR in the time domain over a distribution of samples: https://gwdata.cdn-anritsu.com/en-us/test-measurement/reffiles/Products-Solutions/11410-00919A-Eye-Diagram-AN.pdf
but how would I correctly go about using the periodogram/ power spectrum to find the SNR? Should I take the noise floor to be where out at where the spectra is flat?
I have a time domain data set of PRBS7 with noise, the data only has one non repeated segment of the PRBS7, sampled with 1ps resolution ( why the MATLAB snr() function gives it out past 250GHz) the resolution isn't so great I think because the length of this sample is 6500ps. Matlab uses a default kaiser window for filtering, I may be able to do better with different filters, but want to see if this is on the right track.


texts: Differential Modulation in a SIMO system

texts:
In a SIMO system with a DBPSK modulation, the reception is given by
$$\sum_{p=1}^{N}y_p [n]=z[n]$$
with $y_p[n]=r_p^{\ast}[n-1]r_p[n],\ r_p[n]=x[n]h_p[n]+w_p[n]$, where $N$ is the number of antennas, $h_p$ the channel impulse response for the $p^e$ antenna and $w_p[n]$ the noise for the $p^e$ antenna.
After we have the decision process. With a DBPSK modulation we have $2$ symbols $\{d_1,d_2\}=\{-1,1\}$.  Consequently, the decision process is given by
$$\arg\min_i\left\lvert z[n]-d_i\right\rvert.$$
And if $i=1$, then $z[n]=d_1$.
Is it equivalent to do the sum of SIMO after the decision process and if yes why?
More precisely this process: $\arg\min_i\left\lvert y_p[n]-d_i\right\rvert$ and if $i=1$ then $y_p[n]=d_1$. And after, $z[n]=\sum_{p=1}^Ny_p[n]$ with $z[n]$ equal to $d_1$ or $d_2$ depending on the majority. That is to say, if there are more $d_1$ than $d_2$ then $z[n]=d_1$.


texts: Making sense of Haar transform and inverse Haar transform

texts:
Yesterday, my teacher taught us about the Haar transform (for pictures). We had to implement it in Python and when I finished I was wondering: what was the point?
I can't explain the purpose of what I'm studying: what a shame !

Can someone explain me what is the main purpose of this algorithm for images ?

I would like to tell myself that I can explain everything I study to a random person.


texts: How to plot histogram of difference of two images using MATLAB

texts:
i would like to calculate difference of two images. Then, histogram of difference of two images. So I can plot a histogram but I am not sure whether it is true or not? Also, I am not sure about what should be second parameter of built-in histogramfunction.

My two images are original_result and output_image. And difference of two image is image_of_dif.
my result:

image_of_dif = double(original_result) - double(output_image);
figure; histogram(image_of_dif(:), 511);


texts: Why is it easier to extract color in HSV model than in RGB?

texts:
I am following the open-cv tutorial and they claim that:

  In HSV, it is more easier to represent a color than RGB color-space.

after which they convert the image from BGR color model to HSV, claim some color region as blue and bitmask based on that.

My question is: why is it easier to represent color in HSV model?


texts:
I have this app in my phone which tells me the LTE UL frequency and power:

so I went with my SDR and measured the received signal at that frequency:

Now, how can I be sure this is the transmitted signal from my phone? As I made a call to and from this phone and nothing changed.

I did a second experiment when the phone switched to LTE band 20 and the spectrum looks quite different:

I also recorded this video when the phone is just in "standby" and this other video when the phone is sending an email with an attachment.

I have the feeling I'm not seeing the correct information in the LTE band 3 because my dongle (this one) is not actually receiving anything there, although it shows an spectrum? My goal here is to be able to detect my phone's transmitted signal and then, to make sure I can distinguish it before I invest in a more expensive SDR to be able to monitor higher bands.


texts: applicability of dictionary learning in compressed sensing problem

texts:
Compressed Sensing Problem:

$Y = MX$, $M$ = measurement matrix (known), $X$ = full signal (unknown), $Y$ = sampled points (known). Objective is to obtain $X$ using the concept of sparsity i.e. $X = \phi S$, $S$ = sparse vector (unknown), and $\phi$ = a basis which converts the signal to a sparse domain (known). So $Y=M \phi S$, from this experssion we find $S$, and put it into $X = \phi S$ to get $X$.

Dictionary Learning Problem

$P = \psi Q$, $P$ is a signal (known), $Q$ = sparse vector (unknown), and $\psi$ = a basis which converts the signal $P$ to a sparse domain (unknown). We find $\psi$ and $Q$ using alternating minimization algorithms like k-svd.

My question is: Compressed sensing using Dictionary Learning

$Y=M \phi S$, $Y$ = sampled points (known), $M$ = measurement matrix (known), $S$ = sparse vector (unknown), and $\phi$ = a basis which converts the signal $Y$ to a sparse domain (unknown). Is this possible to solve at all?

Referring to appropriate references will also help a lot.


texts: Why is the received signal=information+RF signal+noise,not just information+noise?

texts:
In this paper: https://www.researchgate.net/publication/325008791_Beamforming_Design_for_Max-Min_Fair_SWIPT_in_Green_Cloud-RAN_with_Wireless_Fronthaul

Here is its system model

In this model,it said the received signal in each DR is

$y_k=\mathbf h_k^H \mathbf w_k s_k^D+\sum\limits_{i=1,i \neq k}^{K}\mathbf h_k^H \mathbf w_i s_i^D+\sum\limits_{j=1}^{J}\mathbf h_k^H \mathbf v_j s_j^E+n_k$, Notice that due to the energy symbol $s^E_j$ is randomly generated, which carries no information but only satisﬁes the RF regulations;$s_k^D$ is data symbol for DR k .

Honestly,i don't understand about $s^E_j$,i mean i know the received signal of DR1,

$y_{DR1}=$(signal from RRH1) + (signal from RRH2 and RRH3,etc)+(noise),that is

$y_k=\mathbf h_k^H \mathbf w_k s_k^D+\sum\limits_{i=1,i \neq k}^{K}\mathbf h_k^H \mathbf w_i s_i^D+n_k$

but i don't know where does  $\sum\limits_{j=1}^{J}\mathbf h_k^H \mathbf v_j s_j^E$ come from

I have a thinking before,the signal RRH transmit is information+RF signal,that is $s_k^D+s_j^E$,but in the other paper,they will only mention the $s_k^D$,like this paper: https://arxiv.org/pdf/1805.08898.pdf ,it just said $y_k=\mathbf h_k^H \sum\limits_{j=1}^K \mathbf f_j s_j+n_{a_k}$,so does anyone know about what the $s_j^E$ is?


texts:
What is the causality & stability status for three cases shown (aso in attached photo) ?

$$H(z) = \frac{z(z-1)}{(z+1)(z+\frac{1}{3})} $$

for three possible regions of convergence as:

a-) |z| > 1

b-) |z| < 1/3

c-) 1/3 < |z| < 1

Am i ok as below?

a) Causal & marginally stable

b) anti-causal & unstable

c) non-causal & marginally stable


texts:
I just started learning about image processing. I am using the book "Digital image processing" by Gonzalez and Woods but I don't like this book very much. I would like to read a book which can actually make me interested in image processing.

Can you suggest some good resources?


texts: Measuring time distance between bass tones and send it as a signal

texts:
I want to measure in my file the time distances between two or more bass tones.

Explanation:

I took a YouTube video and converted it to a .wav file.

As you can already see in the title, the bass was manipulated, before it was uploaded. (Probably with audacity or something else). I cut out about 16 seconds, from the beginning of the video and read the audio file in matlab. Now in theory, (i believe so) bass (lower frequency) generally have a higher amplitude compared to the other tones. A higher amplitude means, that the tone is louder. So basically, if i do a fft on it, i get the frequency spectrogram of my signal, which is represented in the time domain. Then i square the frequency spectrogram with 2. I dont know, how is it called, since english is not my mother language, but I believe this is the absolute value in the mathematics or also the power from the frequency spectrogram. As i mentioned, the amplitudes of bass tones are very high, therefore i should be able to see, when a bass tones occurs in the spectrogram.

I want to measure the time distance between two or three bass tones. If i get this, then i want so send this values in the form of signal through an Arduino Uno, which controls a vibration motor. If the bass comes, for example, every two seconds, then the vibrations motor will/should vibrate every two seconds too.

Question:

I want to measure the time distance between two bass notes and send it as a signal to my motor. Depending on the music type of my file. What are the necessary steps, to do that? How do i have to write my code line? I have already tried some possiblities, but i don't know further and i want to realise it with matlab, since i am not experienced in other languages. I can alos post my code, if needed.


texts:
Please check if my answer to GATE IN 2010 question 11.20 is correct/can be improved upon.

So, every $\frac{1}{f_s}$ sec, a sample is taken. The signal amplitude is quantized into $2^n$ levels such that each sample can be encoded using $n$ bits. The question (I think) asks what is the minimum bandwidth a channel needs in order to transmit these bits.

We have $\frac{1}{f_s}$ sec time and $n$ bits to send. So the bit rate would be $nf_s$ bits per second. Since each "bit" is sent as a pulse across the channel, the pulse rate $f_p = nf_s$. So by the Shannon–Hartley theorem we can conclude,

$$nf_s \leq 2B$$
$$B \geq \frac{nf_s}{2}$$

So the answer is (c)

The question asks what the bandwidth needed for "faithful reconstruction" is, I guess they mean that if you don't have at least this large a bandwidth errors will creep in and you can't reconstruct the signal from the n bit code at the receiver end?


texts: Why filtic function does not work for a specific use?

texts:
And how can I solve this issue?
I designed a filter via bilinear transformation in order to obtein a high-pass filter of Butterworth. When I want to set initial conditions with filtic function, it does not give me what I expect. I have a signal with an offset, then I filter that with the designed filter. But the case is that the first values of the filtered signal are still remaining from the original offset.
PD: I expected that at the begginning the signal starts with value of 0. Not a transient as shown in the following image:

That is my code in order to apply the filter to my signal:
% PIOD is the sample period
% F_c is the cut-off frecuency
[num_s, den_s] = butter(2, 1, 'high', 's');
    r = F_c*PIOD;
    F_a = 1/(2*pi);
    F_s = F_a/r;

[NUM_z, DEN_z] = bilinear(num_s, den_s, F_s, F_a);
newOffset = 0; % I set the parameter in that way because the filter removes all low-frecuency components of my signal.
iniConds = filtic(NUM_z, DEN_z, [newOffset newOffset]);


texts: DFT of sum of sinusoids with random zeroed samples

texts:
I have a noisy signal consists of sum of sinusoids, I had a situation where some of the time domain samples are zeroed randomly.
The following figure shows the DFT before and after zeroing, the number of zeroed samples are 40 out of 128 samples.

Obviously there is no much degradation of the DFT spectrum,.
What is the math behind this, and I would like to get some keywords to search any relative subject that discuss the limitations of zeroing.


texts: What are Simulated B-mode and phantom images?

texts:
Could someone please explain what simulated B-mode and phantom images are? I've seen them in several IEEE papers. How can one create these images?

What is the formula for signal-to-noise ratio and contrast-to-noise ratio?
Please share MATLAB code for the above ratios.


texts: Determine maximum frequency of input signal to make system LTI

texts:
This is question 4.26 from the third edition of Alan Oppenheim's textbook "Discrete-time Signal Processing". It is stated as follows:

Firstly, the answer is the input signal should be bandlimited to 12 kHz. I'm having trouble seeing why it is the case.

My reasoning:

The cutoff frequency of the low pass filter is obviously 8 kHz, so any frequency component of the discretized input signal beyond 8 kHz will be removed. But since we do not want aliasing to occur, we want the input signal to be bandlimited such that after passing the sampled signal through the low pass filter we don't get aliasing below 8 kHz. But in the case of input signal bandlimited to 12 kHz, we get the following (a quick drawing):

which causes aliasing, making the overall system no longer LTI.

So where did I go wrong? Any help is greatly appreciated!


texts:
I need to evaluate several different waveforms regarding their doppler tolerance, for use in a radar application. So I came across something called the Ambiguity function.

The following picture shows the Ambiguity function contour-plot of a Barker-Code with 7 Chips.

My problem is that I don't fully understand how to read it.

If I take the 0Hz Doppler-cut, I get the expected, ideal barker autocorrelation. Now consider a target which moves with a fixed velocity. In order to calculate the doppler frequency $f_d$ I can apply the following formula:

$$ f_d = \frac{\Delta v}{c} f_0$$

with $\Delta v$ being the (relative) velocity of the target, $c$ being the velocity of the medium (or the waves in the medium) and $f_0$ being the emitted frequency.

Now my problem is, that a barker code is not just built up by a single frequency which I could use as value for $f_0$. The barker code has a whole spectrum of frequencies (fft). This also means that I have to look at a bunch of doppler frequencies istead of looking just at one, right?....

So I cannot just take, for instance the 20kHz doppler cut, to see what correlation result I can expect for a target with a certain velocity.

What frequency of my signal-spectrum do I need to use to calculate the doppler frequency?

In my particular case I do a BPSK-Modulation of a 13x13 (nested) barker code, before sending it out and calculate the matched-filter response on the received signal. In order to get an idea of how the matched-filter output looks, I would like to take a "doppler cut" at $f_d = ..$. But should I take the carrier-frequency as $f_0$ ? Or should I take the maximal frequency that I have in my spectrum as $f_0$? ($f_0$ is needed to calculate $f_d$)


texts:
I am looking for a noisy signal using STFT. My window length is 128 and I am using 75% overlap. I am using a Hanning window before running the FFT process. I am using Quinn's 2nd estimator for interpolation after the fact.
What I observe is the detected signal jumping frequently between bins. In the picture below the red is the detected frequency (around 190Hz) the green is the detected bin (sampling rate is 1000Hz so bin size is 7.8Hz)

What I would like to know is - is this likely to be an artifact of the method I am using, or is it simply that the frequency is varying a lot. What would be a suitable way of coming up with a more reliable prediction without losing time resolution?
I am using a low pass filter at 20Hz to smooth the output, but it still does not remove this oscillation.

Here is a full FFT of the signal over a much long time period:

I guess that indicates that its simply the signal causing this.


texts:
I am a complete novice to the world of signal processing, and I am an environmental engineering grad by degree (i.e. zero background in signals/systems). We acquired a couple sensors and a data recorder at work and I am required to analyze the data we measure. Pertaining to that, I have two questions:

Is anyone here familiar with Engineering Data Management software by Crystal Instruments?
I just need to learn the basic nuts and bolts of signals without having to go in depth into the math of deriving the Fourier Transform or signal design etc. Is that a possibility, and what is a good resource for this?


texts: Is my answer incomplete? Checking the stability of a system

texts:
Yesterday, during my exam, I had the following exercise:

  Given $$H(s) = \frac{1}{s^2+2s+4}$$ check if it's stable.

which was supposed to be the hardest (since it was the last one). From my knowledge, I quickly found out the poles, checked the real part of the pole (which was $-1$) and said that the system is stable. Is my argument incomplete? Everyone in the classroom seemed to write a lot more at that final exercise.


texts:
A recent project requires me to get into some basic DSP, in C.
I receive PCM samples of a BFSK signal (Bell 103). The sample rate is 8 kHz.
The mark and space frequencies are 1070 and 1270 Hz.

To determine the frequencies from the PCM samples, and thus the 1's and 0's, I wanted to use the Goertzel algorithm.

However, I have some doubts:
The Bell103 FSK signal can be 110 or 300 bps. 300 bps would mean 3.33 ms per bit. With the 8 kHz sampling rate, that would mean that every FSK bit is sampled ~26 times.
If I'm correct, this would mean a 8000 / 26 = ~300 Hz frequency resolution, but the FSK mark and space frequencies are only 200 Hz apart.

So I can see two ways to tackle that problem:

Increase the sample rate (I might be able to double it, although not easily)
Perhaps it is possible to play with the locations of the frequency bins, so the mark and space frequencies still fall into their own bins. Though, this might cost noise resilience?

I would very much appreciate your insight!

Update
The resulting C code for Dan Boschen excellent answer:

float demodulate (int sample)
{
  static const float coeffs[5] = { 0.14543, 0.19161, 0.32591, 0.19161, 0.14543 };

  static int xBuf[20]; // Buffer to store the new plus the last 19 samples
  static int x1Buf[5]; // Buffer to store the new plus the last 4 discriminator outputs

  // Shift the new data into the buffers
  for (int i = 0; i < ((sizeof(xBuf) / sizeof(xBuf[0])) - 1); i++)
  {
    xBuf[i + 1] = xBuf[i];
  }
  xBuf[0] = sample;

  for (int i = 0; i < ((sizeof(x1Buf) / sizeof(x1Buf[0])) - 1); i++)
  {
    x1Buf[i + 1] = x1Buf[i];
  }
  x1Buf[0] = xBuf[0] * xBuf[((sizeof(xBuf) / sizeof(xBuf[0])) - 1)];

  // Compute the result
  float result = 0;
  for (int i = 0; i < 5; i++)
  {
    result += coeffs[i] * x1Buf[i];
  }

  return result;
}

Input data and spectra

More test results
The input data: 216 samples of 1070 Hz, and then 216 samples of 1270 Hz. The spectrum is shown below, and remains the same until I use less than ~70 samples per frequency. Then the peaks become less clear.

The resulting filter output, which I think looks very good:

As this looks good, Andy Walls' point saying it could be the Carrier Frequency Offset is worth investigating. Though, I will have to read up on the background first.

Also, Dan's point suggesting to test the filter with 2 taps removed seems very promising:


texts:
I am currently trying to understand mathematically the amplitude shift keying modulation technique. My question is, say I wanted to compute the Fourier series of a basic pulse train, it is quite simple since it is periodic. But in digital transmission (Unipolar) the signal is random, how does one compute the spectrum of this transmission. I hope my question makes sense.

Here is a snapshot of some notes I found online. The data signal is a random signal of 1's and 0's. How can anybody interpret the spectrum of it? Thanks.


texts: Understanding of Random Process, Random Variable and Probability Density Function

texts:
I just wanted to confirm my understanding of a Random Process, Random Variable and the its Probability density Function.

Here is the way that I looked a Random Process/Random Variable:

If we consider a sample space $S$ consisting of $n$ outcomes labelled $s_1,s_2,s_3\ldots,s_n$. Suppose if we perform $n$ trials of experiment, we are sure that the probabilities of outcomes $s_1,s_2,\ldots,s_n$ will change over time. So, here the graph $X(s_1,t)$ denotes the changing probability of event s1 over time. graph $X(s_2,t)$ denotes the changing probability of event $s_2$ over time. Similarly we have $n$ functions of time. The whole set of functions $X(s_1,t), X(s_2,t),\ldots,X(s_n,t)$ constitute a Random Process.

Pictorially represented below:

Now when we observe the Random Process at a specific time $t_k$, that is the value at $X(s_1,t_k), X(s_2,t_k),\ldots,X(s_n,t_k)$, if we denote them by $(a_1,a_2,\ldots, a_n)$. Now the mapping between the outcomes $(s_1,s_2,s_3,\ldots,s_n)$ and its probabilities $(a_1,a_2,\ldots,a_n)$ are collectively called as Random Variable. That is we get each outcome and its probability (For example, Probability of outcome $s_1 \rightarrow a_1$ at time $t_k$, probability of outcome $s_1 \rightarrow a_2$ at time $t_k$).

It seems a Random variable $X(t_k)=\{a_1,a_2,a_3,\ldots,a_n\}$ is a collection of outcomes and its probabilities. So, we can get the probability density function of this Random variable by plotting this probability values $(a_1,a_2,\ldots,a_n)$ in a graph. ($X$ axis being possible outcomes $s_1,s_2,s_3,\ldots,s_n$ and $Y$ axis being its probabilities $(a_1,a_2,\ldots,a_n)$. And this probability density function depends upon the time when a random process is observed.

Could you please let me know if the above understanding of a Random Process/Random variable/Probability density function is correct?


texts: Any basic paper on biomedical signal processing to practise with?

texts:
I am quite interested in biomedical signal processing and I am looking for some biomedical signal processing papers in order to reproduce the results that they obtained. The idea is to redo what they did so I can learn about the topic and improve my research skills.

The papers should fit the following requisites:

The data that they use must be public.
Most of the work could be done in Matlab or similar software.

Papers about biomedical image processing are also welcomed.

Thanks!


texts: What are some easy to detect reference mark shapes and corresponding detection methods?

texts:
Question Details:

There are a variety of image processing algorithms useful for detecting reference marks (contour tracing, FAST, MSER, Haar Feature-based Cascade Classifier, or even just Harris Edge detector, etc).

There are a variety of simple geometric shapes one might pick for use as reference marks (circle, square, X, etc).

I am wondering if someone has some experience with what combinations work best? Some additional criteria I have:

using an algorithm implemented in openCV would be great
Background invariance: detection algorithm should be robust against
random background features(folds in clothing, random sharp corners, random
colors present in background, speckle noise)
Distance invariance: detection algorithm should be stable with
respect to scale. (i.e. is should work whether the reference mark
takes up a 100x100 pixel square in the image or 30x30 pixel square)
Angle invariance: detection algorithm should not fail if the
reference mark is viewed at an angle
I am using a 640x480 webcam as a source of the images, so image processing at better than 5-10 fps would be nice

Additional Info:

My goal is to print out a fixed number black shapes on white paper. Place them in arbitrary positions in the scene that I am imaging with a webcam, and try to detect the center coordinates of each of the black shapes using a c++ program w/ openCV.

I am wondering if there is any consensus about what type of shape is the easiest to detect and how to do it.

Approaches that I have tried:

Detecting concentric circles using contour tracing: 1) Find the contours that are n times nested 2) compute the center point.  The problem is that it is hard to resolve the rings at far distances (>5 feet) and angles.

Detecting cross shapes using contour tracing: 1) find contours, 2) find convex hull of each contour, 3) find number of convexity defects 4) compute the center if convexity defects == 4. Alternatively I have tried finding the depth of each convexity defect and comparing it to the width of the bounding rectangle around the contour to determine if it is a "real" convexity defect or just due to noise. This method works but sometimes certain background features, like folds in clothing, can make extra objects detected.


texts: Looking for a way to fill holes in objects, and break bridges between them

texts:
I am trying to extract building footprints from satellite images. Using a series of morphological operations i.e erosion and opening by reconstruction, I'm able to obtain the footprints, albeit with a lot of noise. Please refer the image below:

As you can see, there are some 'bridges' left between the buildings, and I'm not being able to remove them with opening operations. There are also many holes inside the footprints. I'd love any inputs on how I can improve my result.

P.S I am working on this using openCV and Scikit-Image on python.

Here's the original image if anyone needs it:


texts: Low pass signal filtering using FFT or simple infinite impulse response filter

texts:
I am currently in need for filtering accelerometer data for an Android application.
First of all, I used a simple low-pass filter (simple infinite impulse response filter) as follows:

for i from 1 to n
   y[i] := y[i-1] + α * (x[i] - y[i-1])

This helped me achieve a smoother result.

Then I decided to play with FFTs. I used a fast-fourier transform to get the signal into frequency domain and then zeroed some of the high frequencies. Then using inverse fourier transform I recreated the signal. This all worked fine and I know that the FFT and IFT implementations are fine. However, the signal wasn't as smooth as the one that I got from before using the simple infinite impulse response filter. I tried zeroing some further frequencies but didn't give me as good of a result as expected.

What is the reason behind this? I though using FFTs and IFT should technically give me a nice smooth graphs. Is this because of the sampling in FFT?

Thanks


texts: Step response given impulse response $h = e^{-|t|}$

texts:
I was given the above homework problem and I know how the step response is achieved, but I'm not sure how to set up the integrals in order to evaluate the problem. I've attached my work, but it is wrong because I keep getting the wrong answer. The solution is given as

$$S(t) = u(-t)e^t + u(t)(2-e^{-t})$$

*Note: We have not yet covered laplace transform. In my class, we are expressing the step response as running sums/integrals of the impulse response.


texts: Filtering performance on Poisson noise with quadratic data-fidelity

texts:
We recently performed a work on signal filtering/component separation (sparse signal/trend/noise). The cost function contains:

A quadratic data fidelity term,
Some smoothed $\ell_1$ terms for sparsity and positivity promotion.

This was initially designed for Gaussian noise, and performed satisfactorily. Reviewers asked to test the algorithm on the same signals with Poisson noise, and it performed well also.

In many works concerned with Poisson-Gaussian noise mixtures, authors usually use more involved penalty functions and/or use variance stabilization transforms (such as Anscombe's).

Presenting the work to different signal processing folks, several colleagues (signal and image persons equally) said they were "not surprised" that a simple quadratic term would work well with Poisson noise too.

Since I am less a theoretician than a frequentist, and a bayesian (much) less than a frequentist, I do not understand the reason behind the relatively good behavior with both Gaussian and Poisson perturbations.

May a reader offer practical or theorical hints behind this "non surprise"?


texts:
I'm trying to self learn the art of signal processing whilst moving through my third year pure maths degree.

Sorry if my terminology is incorrect however I hope I am understandable!

I am looking at data which is coming from an accelerometer, distance data from a separate sensor and time data incrementing by 0.01 seconds e.g. to be clear in case my terminology is incorrect I have a dataset which has a row for each 0.01 seconds with the row having data from the accelerometer and distance sensors. I believe this means the data is sampled at 100 Hz.

Please can someone confirm that my choice of using a digital filter is correct?

My reasoning is that the data is not analogue and is digital and as such I should not use a standard Butterworth (or other) filter and should look for a digital version. Is this reasoning correct?

I want to use the data to compare the second derivative with respect to time of the distance with the RSS of acceleration and before I do this I want to 'clean' up the data as much as possible and it is my understanding that filtering will give me this.

I am using Octave to perform the maths and have various pieces of code to filter the data, however I do not feel like I understand the filter settings I should use! Before I start to try and understand the filter settings are all my assumptions and reasoning reasonable?

My Octave code for my filter is as follows:

%I use Octave, however I believe Matlab will be very similar if not identical

% I believe that my sample frequency is 100 Hz.
mysamf = 100;

% Nyquist frequency. I believe this is set to half the sample frequency
Fnyq = mysamf/2;

% I do not understand the cut-off frequency, however I set it to 45
% I can see through plotting the results that it does make an impact.
mycutf=45;

% Here I create a 1st order Butterworth filter, using the above restrictions.
[b,a]=butter(2, mycutf/Fnyq);

% I pass my dataset that contains the displacements.
output=filter(b,a,v_dist);

Edit:

I realize I should have explained this at the beginning however I didn't think that the source of the data would influence the filtering approach (digital/analogue).

My Sensor data is coming from a Pogo stick - the acceleometer mounted at the base of the stick and a displacement sensor measuring the movement of the stick and spring assembly.

The Pogo stick is being used by a Gazelle on steroids so is going wild, however is always bouncing around on and off axis, big jumps small hops, soft ground hard ground.

Thanks,

Sam.


texts:
I am a bit confused if the following signal is baseband or passband:

$f(t) = x(t) \cos(2 \pi f_c t) - j \: y(t) \sin(2 \pi f_c t),$
where $j = \sqrt{-1}$.

Since it is clearly not real, I cannot say it is passband. On the other hand, since it contains the frequency $f_c$, it should not be a baseband. Am I missing something?

Thanks,


texts:
I have a homogeneity image that includes two regions $\Omega_1$ and $\Omega_2$. How to represent the image by decomposition of two regions?

For example, the famous way is representing by the mean feature. Image $I$ can be  represented as follows:

$$I=u_1c_1+u_2c_2$$

$c_1$ is mean of region $\Omega_1$

$c_2$ is mean of region $\Omega_2$

$ u_1 =
  \begin{cases}
   1 & \text{if is $\Omega_1$ }\\
   0       & \text{otherwise}
  \end{cases}
$

$ u_2 =
  \begin{cases}
   1 & \text{if is $\Omega_2$ }\\
   0       & \text{otherwise}
  \end{cases}
$

Do you know another way to represent image $I$ without using mean feature. Thank you so much

As the question, I will show a simple example as following


texts: differential phase tracking loop for the receiver

texts: For a DBPSK modulation, how can we track the differential phase? I thought about using a phase tracking loop but I did not find articles for this.


texts: Allpass filter feedforward/feedback design and code

texts:
I want to design/implement a simple feedforward/feedback all-pass filter, and I am having some troubles and questions with it.

From Shroeder design (based on J. Smith article here):

I came up with the following pseudocode (for first-order all-pass filter, meaning the delay was set to 1 sample, and b0 = aM):

float allPassGain = aM, value from [0.0, 1.0);

float allPassFeedback = 0.0;
float allPassDelayedSample = 0.0;

float processAllPass(float x)
{
    float delayInput = x + allPassFeedback;
    float feedForward = delayInput * allPassGain;

    float delayOutput = allPassDelayedSample;
    allPassDelayedSample = delayInput;

    allPassFeedback = delayOutput * -allPassGain;

    return delayOutput + feedForward;
}

Here x is an input sample, to process some signal with this all-pass I am going through the signal feeding it sample-by-sample into processAllPass, and store the outputs in the parallel output signal.

But unfortunately it seems like this approach doesn't work. For example, if I create a simple Phaser with a set of successful all-pass filters designed like that, I don't get the desired effect, instead the signal becomes unstable and shoots through the roof.

Does the pseudo-code have issues? I am setting aM to an arbitrary value and the delay line length is strictly 1.

Matt L.'s answer helped me to fix the code, and here is the fixed pseudo-code if that would be interesting (please also note that for the Phaser effect I find it better to switch coefficients' signs, it is slightly different version of the all-pass filter, presented in e.g. "Reducing Artificial Reverberation Algorithm Requirements using FDN" by Jasmin Frenette):

float allPassGain = aM, value from [0.0, 1.0);

float allPassDelayedSample = 0.0;

float processAllPass(float x)
{
    float delayOutput = allPassDelayedSample;
    float feedBack = delayOutput * allPassGain;

    float delayInput = inSamp + feedBack;
    float feedForward = delayInput * -allPassGain;
    allPassDelayedSample = delayInput;

    return delayOutput + feedForward;
}


texts:
I am working with beamforming algorithms for speaker arrays. One of the problems we face is that we need to estimate the maximum amplitude of our test signals after we applied FIR/IIR filters to them. I am looking for ways to express the reduction in headroom that a given set of filters would give us. Ultimately I want to know by how much I have to attenuate my input signal to definitely avoid clipping in the DAC, with respect to the filter.

For sine sweeps, this is easy: The maximum of the filters magnitude response is also the maximum amplitude gain we can expect. However, for broadband signals, this is not as simple.

I considered adding up $N$ sine waves of frequencies $\omega_n$ covering the range of 0Hz - Nyquist. If my filter input signal consisted of sines with amplitude 1, the maximum amplitude of this "stacked sine" signal would be $y_{max} = N$.

Looking at an output signal of the filter, the same method can be used to estimate the maximum amplitude: This time, the amplitudes would not be 1 but $|H(\omega_n)|$ and the maximum output amplitude would be $\sum_{n=0}^{N-1}|H(\omega_n)|$.

I could now compare the maximum input amplitude with the maximum output amplitude:

$AmplitudeGain = \frac{\sum_{n=0}^{N-1}|H(\omega_n)|}{N}$

My hope was that I may see by what amount I'd have to attenuate my broadband input signal to avoid clipping. The truth is that I'm really calculating the average of my magnitude response and that there are signals for which the calculated gain would produce clipping. Consider the following magnitude response, which is the result of a superdirective beamforming optimization:

As you can see, the maximum gain is about 13dB, but my formula would return the average which is in this case -12.8dB. This tells me that there is an error in my thinking. Adding up the respective maximum values of all sine-components of a broadband signal should give me the highest amplitude this signal could ever reach, right? Apparently my approach in itself is wrong.

How could I better estimate the maximum amplitude gain of my filter for broadband signals?


texts: How to calculate the PSD from the complex calculated STFT?

texts:
I have calculated the STFT with scipy python library:

f_spec, t_spec, Spectro= sc.signal.spectrogram(My_Signal, fs=1.0, window='hamming', nperseg=180,
                        noverlap=None, nfft=2048, detrend=False, return_onesided=False, scaling='density',
                        axis=-1, mode='complex')

I wanted to get the same result as spectrogram function of MATLAB and now I want to calcluate its PSD in dB.
In fact I have found several expression in internet such as :

PSD=Spectro^2

or :

PSD = 10*log10(abs(Spectro))

I am not sure what to use can any one help me?


texts: Extreme value at start of FFT proccesed signal

texts:
I have a signal with frequency of 1000 Hz, and it consist of velocities of an hot-wire. The measurements are taken behind a cylinder as air is blown on the cylinder. When i process the signal of each of the cases (different start velocity) I get an extreme value at the start, just a single point. What is the best way to treat this, because it is an abnormality and I should "remove it"?

What is best to do in a case like this, should I use a window function like hanning or is this actual good data?


texts:
If you calculate a simple moving average over a window length that is equal to the period of the sinusoid, you get a straight line (=0 because the wave is symmetric around the X-axis): the wave has a period of 40, equal to the length of the window of the simple moving average: so the filter weights are 1/40, 1/40,... 40 times. This is kind of obvious because a sinusoid is like a reflection of the same shape around its axis.

Which non-trivial moving average weights would you need to find to get a filter that returns the same output as its input (so besides SMA(1) )? So I want to find the filter weights of some type of average over some window length, that when multiplied with their respective values of the sinusoid, while sliding the window over the sinusoid, add to a sum equal to the sinusoid.
ps: is it possible to answer using as little signal processing / engineering terminology as possible please? Like you're talking to a mentally challenged person.. :)


texts: Choosing the frequency for a comb filter

texts:
I have an audio sample. From doing FFT on it it looks as if I need to use a comb filter to remove resonant frequencies. This is what I generate:

I honestly have no clue where to start unfortunately.


texts:
I'm trying to calculate resultant function from adding two sinusoids:

$9\sin(\omega t + \tfrac{\pi}{3})$ and $-7\sin(\omega t - \tfrac{3\pi}{8})$

The correct answer is $14.38\sin(\omega t + 1.444)$, but I get $14.38\sin(\omega t + 2.745)$.

My calculations are (first using cosine rule to obtain resultant $v$ as):
$\sqrt{9^2 + (-7)^2 - (2 \cdot 9 \cdot (-7) \cdot \cos(\pi - \tfrac{\pi}{3} + \tfrac{3\pi}{8}))} = 14.38$

And the angle (using the sine rule):
$\pi - \arcsin(|-7| \sin(\pi - \tfrac{\pi}{3} + \tfrac{3\pi}{8}) / 14.38) = 157$ ° or $2.745$ radians.


texts:
From the Wikipedia article:
"An inverse FFT is computed on each set of symbols, giving a set of complex time-domain samples. These samples are then quadrature-mixed to passband in the standard way. The real and imaginary components are first converted to the analogue domain using digital-to-analogue converters (DACs); the analogue signals are then used to modulate cosine and sine waves at the carrier frequency,  f{c}, respectively. These signals are then summed to give the transmission signal, s(t)."

So, information is added to a pure sine (or cosine) wave. This causes the wave to have not just one frequency, but a range of frequencies within a bandwidth that can be seen in the frequency domain of the signal.
 Having found out about this only yesterday, there are a number of questions.
 I've added an image of a regular time domain OFDM signal found somewhere on the internet.

Does the modulated signal really pass through the very narrow (ideally, 20 MHz in regular LTE) bandpass filter at the receiver? At a center frequency of 2 GHz that would mean to bandpass only what is within 1.99 GHz and 2.01 GHz, which sounds impressive to me.
Wouldn't even the slightest distortion from the emitter move the frequency of the signal out of the passband?
At 2 GHz operating frequency (analog time domain signal, at the LNA), there are 2*10^9 cycles in a second. If  the number of carriers is 2048, and a symbol is a string of 2048 cycles or slightly more including the cyclic prefix, doesn't it mean that the theoretical maximum symbol rate is (2*10^-9)/(2048+prefix length)? This would mean that the signal is transmitted continuously.
This is not true, however, since the symbol rate is a function of the sampling time, Ts, which is 32.552 ns. So, I don't really understand what FFT samples has to do with the 2 GHz analog signal that is present at the receiving LNA. My reasoning is that I could digitize the signal with any number of samples, get a plot for each 2048-cycle sequence then apply FFT.

If the graph below is the LNA signal of 2 GHz LTE, what would the period of a cycle be in nanoseconds? There are about 20 cycles from what I understand. How many cycles of this type would a symbol take?

Later edit:
Regarding the third question, I've found an answer.
Digital processing of the signal is done in the baseband, which is independent of carrier frequency. It needs to be converted into the passband. These links have more information:
IFFT and OFDM upconversion

baseband and passband modulation

Later edit 2: it seems that there are many ways to convert the baseband OFDM into the passband. Constant Envelope OFDM is one interesting way to do it, the baseband OFDM signal is phase modulating the carrier. This is in contrast to regular OFDM where the baseband is somesort of amplitude modulating the carrier.
More info at "Constant Envelope OFDM Phase Modulation", for example.


texts: why do low pass and high pass filters generate a phase shift?

texts:
I just learned following notation for a sine wave:

$A e^{j\phi t}$

A low passfilter and a highpass filter respectively generate a phase shift in the complex plane of the sine wave as follows:

$A e^{-j\phi t}$ and $A e^{+j\phi t}$

I don't understand what phase shifting has to do with letting higher or lower frequencies intact... How do these things( filtering and phase shifting) relate to each other? They just seem like to completely and independent things to me


texts: Underwater acoustic channel is giving me a flat BER vs SNR curve

texts:
I need to do OFDM and GFDM signal transmission in underwater acoustic channel. I have my underwater acoustic channel as follow.

function [h,delay_bar,gain_tap,varargout] = acousticChannel(setup,gain,delay,doppler)
% Generating the distrubition of delays

distribution_delay = makedist('exponential','mu',delay.mean);  % Generating an exponential pdf for Dtau

Dtau        = random(distribution_delay,setup.paths,1);        % Vector of Dtau exponentially distributed
Dtau_index  = ceil(Dtau/setup.Ts); % Indexes of Dtau vector in disrete time

v = sum(Dtau_index);
 delay_index = cumsum(Dtau_index);                              % Calculating indexes of multipaths for discrete time
     delay       = (delay_index - 1)*setup.Ts;

% Generating the distribution of gains

alpha = log(10^(gain.attenuation/10))/setup.delayspread;       % Exponential attenuation power factor

gain_variance = exp(-alpha*delay);                             % Calculating the gain variance for each multipath
gain_tap      = raylrnd(sqrt(gain_variance*2/(4 - pi)));       % Calculating the gain for each multipath

gain_tap = gain_tap/norm(gain_tap);                            % Normalizing gain taps

% Doppler effect

c = 1500; % Sound speed

% Testing type of doppler effect in channel

if(strcmp(doppler.type,'none'))
    a_max = 0;
    varargout{1} = 1;
    varargout{2} = 1;
elseif(strcmp(doppler.type,'uniform'))
    a_max = doppler.velocity/c;
    [Q,M] = rat(1+a_max);
    varargout{1} = Q;
    varargout{2} = M;
elseif (strcmp(type,'non-uniform'))
    a = doppler.velocity/c;
    a_max = max(a);
    [Q,M] = rat(1+a_max);
    varargout{1} = Q;
    varargout{2} = M;
else
    error('Invalid type.')
end
delay_index_bar = ceil(delay_index./(1 + a_max))  ;          % Calculating new delays indexes corrected by DSF
delay_bar       = (delay_index_bar - 1)*setup.Ts;              % Calculating new delays corrected by DSF
h(delay_index_bar) = gain_tap;                              % Channel impulse response
end

I am using these parameters to get the CIR.

setup.Ts = 25e-6;

setup.paths = 6;

setup.delayspread = 0.0246;

gain.attenuation = 20;

delay.mean= 0.001;

doppler.type= 'none';

Bandwidth = 4000;

Since the CIR is a real value, and I need it to pass to baseband, so I did the following

function hl = channel(gain_tap, delay_bar, Bandwidth)
L=20;   %channel taps
f=10000;
fl=0;
hl = zeros(1,L);
for i=1:L
    for n=1:length(delay_bar)
        g=(gain_tap(n))*exp(-sqrt(-1)*2*pi*f*(delay_bar(n)))*sinc((i-1)-delay_bar(n)*W);
        fl = fl+g;
    end
   hl(i)=fl;
   fl=0;
end

So my CIR now is in complex and I can do convolution with my OFDM and GFDM signal. My OFDM and GFDM signal is in time domain. However, everytime I simulate I always get a flat BER vs SNR curve, which mean the range of my BER is too small. I guess that it is the channel that had gave me the problem. Can anyone tell me where is the problem and how can I improve it?


texts:
I wanna show DTFT result and convolution result in f-domain are same.

Additionally, I wanna show sampled function and inverse fourier transform result are same too.

How can I show this? If I use just FFT or DFT, they don't show picture-like.
If I have to use other function (e.g diric, freqz, etc), then please let me know how can I use, and input value mean.


texts: generating a waveform in matlab for rohde and schwarz signal generator

texts: We are doing a test which consists in sending a waveform from Matlab to the signal generator SMB100A and sending it through a cable to the r&s spectrum analyzer just to have a channel. We set the trigger manually in the signal generator in the restart mode, then we set the frequency and the chip rate in our Matlab code as well as the buffer size and the connections. Finally, we read the waveform, which is already stored in the signal generator , and we set ARB state ON: we are using the arbitrary customized digital modulation. However, the channel impulse response is different every time that we run the test: there is a portion of the signal that looks like an offset; we think the signal is shifted because of an inversion in the phase. Any clue about why this happens?


texts: Audio fingerprinting - 2D (time - frequency) filter / Energy differences

texts:
I am trying to implement the algorithm described in this paper. However, I am having trouble understanding the last part where I need to find the energy differences of bands.

In another paper, this process is described as shown below. Also, I am not sure I understand that either. What exactly I should do in this part of the algorithm ? Any hints or tips would be really appreciated.


texts:
Prewitt filters are popular filters in image processing for edge detection
http://en.wikipedia.org/wiki/Prewitt_operator

Can anyone give a proof on why Perwitt and other edge detecting filters are high pass?


texts: Is Bluetooth Low Energy jamming possible with an SDR like the HackRF on GNURadio?

texts:
It seems like BLE jamming is technically possible by just jamming the 3 advertising channels 37, 38 and 39 https://github.com/lws803/BLE-jammer and it has been proven to work on an STM32 + 3x NRF24l01 transceivers. Can the hackRF switch between these 3 frequencies fast enough to produce a consistent jamming effect?
Disclaimer: I understand that this is illegal and I would like to know about this for educational purposes only.


texts: Changing power of an audio signal to a specific dB

texts: Suppose I have an audio signal with power 31dB. I want to change the signal power to 24dB. How can I change the power of that signal from 31dB to 24dB?


texts: On the symmetry of a $2$-dimensional discrete-time signal

texts:
Can we distribute the minus sign as follows?

$$-h[n_1,n_2] = h[-n_1,-n_2]$$


texts: FM: Do rational ratios of carrier to modulator signals really produce harmonic spectra?

texts:
I've read that in FM, all rational ratios of the carrier frequency to the modulator frequency produce harmonic spectrum in the FM signal. Link to what I read.

I don't understand why this is. If for example carrier frequency is 10Hz and modulator frequency is 5Hz, then the spectrum will include the frequencies 15Hz, 25Hz..., which are not integer multiples of 10Hz.

And for some ratios, the frequencies in the sequences come in "pairs",  the ratio 10:4 gives the sequence 2,4,8,10,14,16..., which doesn't look like a harmonic series at all.

What is the proof for this?


texts:
Are the following sequence of operations the same -

Down-sampling filtering followed by gradient filtering with kernel [-1 0 1]
Gradient filtering with kernel [-1 0 1] followed by down-sampling

Could you point me to some math which can answer this question.

Intuitively, I am thinking that these operations are the same. That is because down-sampling can be loosely modeled as low-pass filtering and since convolution is associative, I guess they should produce similar results. But I am not able to quantitatively prove this to be a fact.


texts:
Im new to RADAR signal processing.
I using this doc for ref: https://www.mathworks.com/help/phased/examples/ground-clutter-mitigation-with-moving-target-indication-mti-radar.html
I trying to rebuild the code there, I dont need all the definitions of the antennas and signals because I already have file with I/Q pulses example and I need to process them.
I stuck on the part where I should do [Matched Filter] -> [3-Pulse Canceller]
The way I do it, which i told is wrong, but the result just look better for me is:

calculating Matched Filter for every pulse (assuming I working with 64 pulses) and I arrange the filtered data on Matrix like this:

take the matched filter result row by row and entering the 3PC filter like this:

and than continue the processing..
the matlab code:
%% Matched Filter
mf_buffer_Q = filter(coeff,1,buffer_Q,[],2);
mf_buffer_I = filter(coeff,1,buffer_I,[],2);

%% Three-Pulse Canceller
h = [1 -2 1];
TriPC_buffer_Q = filter(h,1,mf_buffer_Q,[],2);
TriPC_buffer_I = filter(h,1,mf_buffer_I,[],2);

the plot result:

the other way to do it is what i think is wrong but I told is the right way is:
%% Matched Filter
mf_buffer_Q = filter(coeff,1,buffer_Q,[],1);
mf_buffer_I = filter(coeff,1,buffer_I,[],1);

%% Three-Pulse Canceller
h = [1 -2 1];
TriPC_buffer_Q = filter(h,1,mf_buffer_Q,[],2);
TriPC_buffer_I = filter(h,1,mf_buffer_I,[],2);

that means:

the plot result for this:

what output seems better?
what is the right way to do this 2 filters? one horizontal and the second vertical
or I just should do both filters horizontal.
thanks.


texts:
I am trying to apply kalman filter for video processing , i am studying about it from different sources but it take me towards question that if i don't know that where my object come in frame mean i don't know about its angle (location in frame) then is it possible that Kalman filter automatically detect its measurements e.g location (as i already applied algorithms for specific object detection , so i only want that detected object tracking) and then track it in other frames ?

Other thing which come to my mind is that two objects (which i want to detect) come in the same frame and in the same measurements to is kalman filter take them as two different objects for tracking ?


texts: What is 'energy compaction' in simple terms?

texts: This is my understanding of 'energy compaction' and want to know if it is right.  Take a vector.  The energy of the vector is the sum of the squares of its elements.  If A is the transformation matrix that is unitary, it can be proved that the energy in x and Ax are same.  Energy conservation property.  Energy compaction means that the energy of Ax=y is more concentrated in some elements compared to the distribution of energy in x.  DCT is said to have energy compaction property.  Does that mean, for any x, if A is DCT matrix, energy of y will be more concentrated when compared to the x.  Does this happen to every x or x has to satisfy some properties to get this energy compaction?


texts: How to use frame based audio features for machine learning

texts:
I have an audio recording (wav file) that is 2 seconds long. That is my sample and it needs to be classified as [class_A] or [class_B].

To extract MFCC features, I divided the sample into frames (183 frames to be exact) and I've gotten MFCCs (13 coefficients) from each frame.

Now I have 183 feature vectors, the length of each vector is 13.

My question is; how exactly do you use those vectors with classifier (k-NN or SVM for example)? I have 183 vectors that represent 1 sample. I know how to work with 1 vector for 1 sample, but I don't know what to do if I have 183 of them.

Should I concatenate the MFCC vectors from each audio file to transform a matrix of 13x182 to 1x2366 (so I have 2366 MFCC features for every audio file instead of 13 for every frame?), should I use the mean ?

Apologize in advance for any possible obvious explanation that I missed.


texts:
Let $x$ be a $N \times 1$ vector in $\mathbb{R}^{N}$ where $M$ components are zero and the remaining $N-M$ components are standard normal random variables.   $x$ may not be sparse e.g. $M$ may be small.

I am interested in bounding $||Ax||_{l_{2}}$ where $A$ is a $K \times N$ matrix $(K<N)$.

This made me think to look for a restricted isometry like property.   So my question is are there a class of $K \times N$ matrices $(K<N)$ such that  $(1-\delta) ||x||_{l_{2}} \le ||Ax||_{l_{2}} \le (1+\delta) ||x||_{l_{2}}$ with probability $\ge p$  for some prescribed $\delta>0$ and $0<p<1$ ?


texts: Zero-order-hold for two dimensional signal $x(t_1,t_2)$

texts:
From Wikipedia:

  A zero-order hold reconstructs the following continuous-time waveform
  from a sample sequence $x[n]$, assuming one sample per time interval
  $T$: $$x_{\mathrm{ZOH}}(t)\,= \sum_{n=-\infty}^{\infty} x[n]\cdot
 \mathrm{rect} \left(\frac{t-T/2 -nT}{T} \right) \ $$ where
  $\mathrm{rect}()$  is the rectangular function.

We can refer to $\mathrm{rect}()$ also as one-dimensional rectangular function. For example, the product of two one-dimensional rect functions can be viewed as a rect function in two dimension, i.e. a function
that has the value 1 on the square of side length 1 centered at the origin, and has the value 0 outside this
square. I am wondering if there exists, for example, a two dimensional version of ZOH for a signal in two variable, $x(t_1,t_2)$.

Thanks in advance.


texts: What is meant by optimal estimator and how to determine optimality?

texts:
Considering an estimation problem of estimating a scalar deterministic parameter $a$ from the observations $y$ which are corrupted by randomvariable $w$. The observations are $y[n] = a + w[n]$

Least Squares estimator can be used to estimate $a$ when $w$ is a White Gaussian Random Variable. This estimation method is known to be optimal. Why?

What if $w$ is from Poisson Distribtuion or some other non-gaussian, then would the estimator for $a$ be better or worse than the one found using $w$ as Gaussian r.v?


texts: What is the effect of aliasing on the magnitude of the autocorrelation?

texts: I've a question about the effect of aliasing on the magnitude of autocorrelations. From a simulation in MATLAB, I don't see any effect of aliasing or any need to anti-alias filter when I take the magnitude of the autocorrelation. Which means I can undersample the data and then take the autocorrelation. There is a paper "Effects of Aliasing on Spectral Moment Estimates Derived from the Complete Autocorrelation Function" which says something like what I claim. Would anybody please let me know if I've made a mistake?


texts: where we use estimation and detection in communication system?

texts:
I read from the book that we use estimation when we are dealing with analog signal or continuous random variable and the term detection when the transmitted signal is a discrete value even if a received signal is continuous.
I want to know if in digital communication we use both estimation and detection and in which step we do these process.
Also, when we do equalization in the process.


texts: MWE of zero-sum mask in the context of machine learning

texts:
Federated Learning seems to have a lot of potential, I understand it can be done using different techniques, e.g. functional encryption, etc. The simplest seems to be zero-sum masks. For TensorFlow this is e.g. described here and here.
I've tried to find an example of what this looks like, but there isn't much online, there is a short discussion on this SE, but it wasn't very illuminating. There is maybe something on this Chegg, but paywall.
Would anyone have an MWE of doing aggregation using zero-sum masks?


texts: Find Fourier series $f(t) = e^{jx t}$ , $−\pi < t < \pi$

texts:
I need to find the Fourier series of the $f(t) = e^{jxt}$ ,  $− \pi < t < \pi$
What will be the first step to solve it?


texts: How to make noise power estimation on a single tone transmission?

texts:
Suppose we have a single tone transmission over a Single Input, Single Output (SISO) channel impaired by Inter-symbol Interference and Additive White Gaussian Noise (AWGN).

How to compute the noise power estimate in time domain (not using FFT) ?


texts: Improving Digitization by Adding White Noise Before Oversampling

texts:
I was reading a physics book and it said that when digitizing a signal white noise was added to improve the process. I don't understand how this works. Therefore my question is:

When digitizing an analogue signal, how can adding noise be beneficial
when combined with oversampling in time?


texts: Diference between Specific,perceived and perceptual Loudness

texts:
i came across many terms describing loudness ! I understood perceived loudness which is what the user perceived and is related to the user. What is specific loudness and perceptual loudness?

AES Convention Paper 7180 defines specific loudness as

  a measure of perceptual intensity across frequency and time and is measured in units of sone per critical band

which i confuse with perceptual loudness! Can someone make me clear?


texts: Interference between two signals with the same frequency. (exercise from the book software receiver design)

texts:
I find it hard to describe the LPF. This is an exercise from the book Software Receiver Design
Build Your Own Digital Communications System in Five Easy Steps chapter 4.23.


texts: Window functions and the Fourier transform

texts:
I want to clarify the 'correct' way to use windowing and Fourier transforms.

My question is somewhat related to this one, but I have a few additional queries.

I have some real, non periodic signal in the time domain $y(t)$. Since this is a real signal, the data is naturally discrete.

I want to calculate the Fourier transform of this signal, $Y(f)$, within an observation time, $T$. I understand that

$$ \tilde{Y}(f) = \int^{+T/2}_{-T/2} y(t) \exp(-2 \pi i f t) dt $$

$$ = Y(f) \ast T \operatorname{sinc} (\pi f T)$$

where $Y(f)$ is the unwindowed FT of the infinite signal

To avoid the effects of the $\operatorname{sinc}$ function, windowing is recommended to taper the signal within the observation period $T$.

My question is: If I want to calculate $\tilde{Y}(f)$ computationally (e.g. using python/numpy),

Is it required for the time signal to be zero at the edges? Why so?
Does spectral leakage still occur if so?
Aren't we distorting the true time signal $y(t)$?
If we increase the observation time $T$ to e.g. $2T$, how does $\tilde{Y}(f)$ change?


texts: I m designing FIR narrowband pass filter using windowing technique. is bandpass filter is same as narrowband pass filter? I m not finding any good article on this.


texts:
I am trying to generate a signal that represents mixer output of FMCW radar. I am using MATLAB and already tried out this tutorial. There, Phased Array System Toolbox is used to showcase how FMCW radar with sawtooth signal works. The part that is of interest for me right now is up until the range-doppler response. Now what I am trying to accomplish is basically getting the same result (as in pass my signal to plotResponse function and get a range-doppler map with a detection of my target), but I want to get what they call "dechirped" signal from the start - without generating transmitted, reflected and received signals. I've been looking through so many papers in order to determine what formula I need to use to get the correct IF signal, but the more I searched, the more different formulas I found. What I've got now is the formula from this TI webinar, which is
So with that, I am trying to plot the response, here is my code:

c = 3e8;            %speed of light
range_max = 180;    %max detection range
tm = 6*range2time(range_max,c); %sweep time
%tm is 7.2e-6 s
bw = 200e6;         %sweep bandwidth
sweep_slope = bw/tm;
v_max = 150*1000/3600;  %target max velocity
fc = 77e9;          %radar frequency
lambda = c/fc;      %radar wavelength
fs = 72e6;          %sampling rate
%sampling rate based on ADC datasheet
chirps = 64;        %frame size
samples = ceil(tm*fs);  %samples in one chirp

%% target
R0 = 32; %range in meters
V = 40; %radial velocity, m/s

%%
t = 0; %time
mix = zeros(samples, chirps); %mixer output
for i=1:1:chirps
    td = 2 * R0 / c; %round trip delay
    phi0 = 4*pi*fc*R0/c; %inital phase

    for j=1:1:samples
        a = (-2*pi*fc*V*i*tm/c ...    %phase shift
             -2*pi*(2*V*(fc+i*bw)/c + sweep_slope*td)*t);   %frequency
        mix(j,i) = 0.5*cos(a);
        t = t + 1/fs;
    end
end

figure(1)
rngdopresp = phased.RangeDopplerResponse('PropagationSpeed',c,...
    'DopplerOutput','Speed','OperatingFrequency',fc,'SampleRate',fs,...
    'RangeMethod','FFT','SweepSlope',sweep_slope,...
    'RangeFFTLengthSource','Property','RangeFFTLength',2048,...
    'DopplerFFTLengthSource','Property','DopplerFFTLength',256);

clf;
plotResponse(rngdopresp,mix);
axis([-v_max v_max 0 range_max])

The radar that I'm simulating here does't have quadrature channel, so I have to only form real signal (although I tired doing hilbert(...) and cos(...)+1i*sin(...) just to see how that would look). What I assume I get is the Data Cube similar to the one from the tutorial. But no matter how I fiddle with the formula, I can't get the Velocity right. Here's the plot:

The initial phase I tried to form myself, thinking it would be 2*pi*fc*td, where fc is 77 GHz carrier frequency and td is the time delay of 2*R/c.
So what I think is happening is that I don't shift phase properly, since, from my understanding, that is what velocity is primarily estimated upon. The Doppler shift is too small to have significant impact.
Interestingly, I tried to play with the range and velocity values of the target, and noticed, that changing V doesn't affect the target's position on the heatmap too much, it almost doesn't actually. But changing the R0 in increments of 1 makes the target detection on heatmap shift horizontally and cycle to the other side of the map.
So my question is: how do i properly form the IF signal to be able to display it correctly in MATLAB's range-doppler response map?
Also, I acknowledge that I might be plotting or forming the data cube wrong. Or that my math is plain wrong from the beginning. But I've been so desperately trying to solve this by myself for the past week, that I just want someone to show me the light already :)


texts:
Regarding potential distinctions between autonomous, non-autonomous, time-invariant and time-varying systems, I have found out opinions supporting that:

autonomous systems are time-invariant and non-autonomous are time-varying,
(A treatise on stability of autonomous and non-autonomous systems, R. Adhikari - 2013)

linear systems can be time varying or invariant, nonlinear systems can be autonomous or non-autonomous
Book

systems can be simultaneously characterised as any combination among the above, which indicates that they cannot be the same thing.
(Adversary Control Tactics for Cyberphysical Systems, Kontouras, 2020 - non-autonomous linear time invariant)
(Realization and identiﬁcation of autonomous linear periodically time-varying systems, Markovsky et al.-autonomous linear time varying)

The example is about LTI but it would be the same for LTV.
This system:

$\ddot{y}-b\dot{y}-ay=u(t)$
$y=x_{1}$,
$\dot{x_{1}}=x_{2}$,
$\dot{x_{2}}=ax_{1}+bx_{2}+u(t)$
$\dot{\vec{x}}=\begin{bmatrix}
0 & 1\\
 a&b
\end{bmatrix}\vec{x}+\begin{bmatrix}
0\\
1
\end{bmatrix}u(t)$
, is time-invariant since $A$, $B$ matrices are not time-dependent, and since there is a time-dependent input $u(t)$, it should additionally be non-autonomous.
If we feed the output $y$ back, the input $u(t)$, will now become a function of state variables. In this sense, the system should be autonomous.

$\dot{\vec{x}}=\begin{bmatrix}
0 & 1\\
 a&b
\end{bmatrix}\vec{x}+\begin{bmatrix}
0\\
1
\end{bmatrix}u(t)$
$y=x_{1}$
$u(t)=-ky$
Do the previous make sense?
Is it that open-loop control systems are in principle non-autonomous, while closed-loop ones are autonomous, in the absence of additional time-dependent disturbances?


texts:
When computing the PSD, how to manipulate the DC component?

PSD integral is the total signal power, does it include the power of DC component?

In other words, if there is one signal with DC value is high than 0, when we want to compute its PSD, do we need remove DC component first, then use function like pwelch() to compute PSD? If I want to evaluate the partition between spectral density of DC component and AC component, what should I do?

How to evaluate Spectral Density of DC component vs. AC component during computing PSD?
My final target is : Computing the partition between spectral density of DC component and AC component in one signal.


texts: MATLAB model for equalizer using LMS algorithm adaptive filter and unexpected output curve

texts:
The MATLAB code below is for equalizer using lms algorithm adaptive filter and then plotting MSE (Mean Square Error) Vs Iteration numbers

%% Channel Equalization using Least Mean Square (LMS) algorithm
% Author: SHUJAAT KHAN
clc;clear all;close all;
%% Channel and noise level
h = [0.9 0.3 0.5 -0.1]; % Channel
SNRr = 10;              % Noise Level
%% Input/Output data
N = 1000;               % Number of samples
Bits = 2;               % Number of bits for modulation (2-bit for Binary modulation)
data = randi([0 1],1,N);        % Random signal
d = real(qammod(data,Bits));    % BPSK Modulated signal (desired/output)
r = filter(h,1,d);              % Signal after passing through channel
x = awgn(r, SNRr);              % Noisy Signal after channel (given/input)
%% LMS parameters
epoch = 50;        % Number of epochs (training repmiotion)
mio = 1e-3;         % Learning rate / step size
order=12;           % Order of the equalizer
U = zeros(1,order); % Input frame
W = zeros(1,order); % Initial Weigths
%% LMS Algorithm
for k = 1 : epoch
    for n = 1 : N
        U(1,2:end) = U(1,1:end-1);  % Sliding window
        U(1,1) = x(n);              % Present Input

        y = (W)*U';             % Calculating output of LMS
        e(n) = d(n) - y;           % Instantaneous error
        W = W +  mio * e(n) * U ;  % Weight update rule of LMS
        J(k,n) = e(n) * e(n)';        % Instantaneous square error
    end
end
%% Calculation of performance parameters
MJ = mean(J,2);     % Mean square error
%% Plots
figure % MSE
plot(10*log10(MJ),'linewidth',lw)
hg=legend('MSE','Location','Best');
grid minor
xlabel('Epochs iterations');
ylabel('Mean squared error (dB)');
title('Cost function');

But the curve plotted is unexpected, as the MSE should have fluctuations across iterations and to be very smooth like that as it LMS algorithm is used
That's because it doesn't take the Expectation in the adaptive equation.
The curve plotted is as the following:
[
Where the expected plot is as the following:


texts: The essential pre-processing steps in speech signal analysis

texts:
My question is that for simulating a new scheme for speech emotion recognition (feature extraction and classification), what are the necessary pre-processing steps (I mean any kind of normalization and etc. on a EMODB database)?

I appreciate any help.


texts:
I need to find the squares in an image using OpenCV (no problem in matlab or any other, generally what i expect are some ideas).

Consider the test image below :

I need to find those coloured squares in above image accurately (not the white long strips).

What I have done :

I applied the common method (which comes with OpenCV samples), ie find contours in all color planes, approximate it and check for number of elements=4. It works to some extend that, few squares are detected, especially the dark ones.
Next step i did was prediction. ie this arrangement is fixed. So, if some are obtained, I can predict remaining ones. It also worked to some further extend. But accuracy was very bad.

But I feel prediction is not a good method here and it doesn't always provide accurate answers as given by the first step.

What I need :

1) Is there any other better methods to detect these squares more accurately? Or multiple methods?

One important point is that, time is not a problem here. Algorithm can be slow, it doesn't matter. But accuracy is the major criteria.

Sometimes, images can be much more blurry.

And one of the major problem I faced is that some squares have almost similar color as that of background (check column 3 first and second squares).

Looking for ideas, thanks in advance

UPDATE :

Below is the maximum accurate result I got :

Of course, the result image is resized a little bit.

UPDATE 2 :

I have given a much more better solution in my answer below: https://dsp.stackexchange.com/a/7526/818


texts: Maximum Likelihood Through a Noisy Channel

texts:
I have random variables $X_1, X_2, \cdots, X_m $, which can take $n$ values and is distributed iid according to $\Theta=(\theta_1, \theta_2, \cdots, \theta_n)$. That is $X_k$ can take values $\{1,2,\cdots,n\}$ and $P(X_k=i)=\theta_i, \ 1\leq k \leq m, \ 1 \leq i \leq n$.

I observe a random variables $Y_1, Y_2, \cdots, Y_m$, where I have that $P(Y_k=j|X_k=i)=c_{j,i}$.

Let $C$ be the matrix $[C_{j,i}]_{1\leq j,i \leq n}$. I have that $C$ is a full rank matrix.

I want to get an ML estimate of $\Theta$, from observations $Y_1, Y_2, \cdots, Y_m$.

Let $\Psi=(\psi_1,\cdots, \psi_n)$, where ${\psi}_i=P(Y_k=i)$. The ML estimate of  $\Psi$ is clearly the vector of empirical frequencies. That is, we have the ML estimate of $\psi_i$, is $\hat{\psi}_i = \sum_{\ell=1}^{k} I(Y_{\ell}=i)$, where $I$ is an indicator function. Let us call this $\hat{\Psi}$.

I wanted to know if the ML estimate of $\Theta$, $\hat{\Theta}= C^{-1}\hat{\Psi}$. I can prove it if $n=2$, but do not seem to be able to show this for a general $n$.

Another way to put this is that I have a discrete memory-less source, which has a support of $\{ 1,2, \cdots, n\}$. I can observe this though a discrete memoryless channel, with transition probability matrix $C$. I want to estimate the source symbol probabilities. An ML estimate the observed symbol probabilities can be easily derived to be the empirical frequencies. I wanted to know if it can be shown that the ML estimate of the source symbol probabilities is $C^{-1}$ times the ML estimate of the observed symbol probabilities.


texts:
I' trying to implement a QPSK modulation/demodulation.

At one point I have to decimate my signal by 4 for an easier implementation. I've read everywhere that the best way to do it is to use a CIC filter followed by a decimator. So I've read some more and I decided to use the following:

CIC Filter Length: 2
CIC Filter Order: 5
CIC Filter Decimator: 2
CIC Filter Stages: 2

So basically what I do is:

Filter the signal with a FIR filter and coefficients [1 5 10 10 5 1].
Downsample by 2.
Filter the signal with a FIR filter and coefficients [1 5 10 10 5 1].
Downsample by 2.

My question is:

  What is the benefits of a CIC Decimator compared to directly downsampling by 4 and thus disregarding 3 samples out of 4?

I simulated this in order to find what the difference in performance was. As you can see in the two figures below the CIC filter seems to have a strong degrading impact on the BER which makes me wonder why it is used.


texts: Efficiently calculating autocorrelation using FFTs

texts:
I'm trying to calculate an autocorrelation on a platform where the only accelerated primitive I have available is the (I)FFT. I'm having a problem though.

I prototyped it in MATLAB. I am, however, slightly confused. I assumed that it works simply as follows (this is from memory so apologies if I've got it slightly wrong).

 autocorr = ifft( complex( abs( fft( inputData ) ), 0 ) )

However I get a different result than I get from using the xcorr function.  Now I'm fully expecting not to get the left hand side of the auto correlation (as it's a reflection of the right hand side and thus not needed anyway). However, the problem is my right hand side appears to be, itself, reflected around the halfway point. Which effectively means that I get about half the amount of data that I'm expecting.

So I'm sure I must be doing something very simple wrong, but I just can't figure out what.


texts: Comparing two time domain signals in a scale and shift-invariant way

texts:
I have two signals in the time domain, call them $S_1(t)$ and $S_2$(t). Because of calibration issues relating to the underlying devices that these signals are obtained from, they will not necessarily have the same scale or mean. What is the appropriate way to compute a measure of similarity such that, if $S_2(t)$=$C_1 * S_1(t) + C_2$, where $C_1$ and $C_2$ are constants, my measure of similarity will say that these signals are identical? Or at least indicates that they are very similar?

Edit: The solution provided by Digiproc is indeed a good solution to the problem as I originally stated it. However, it seems that I simplified my original problem too much for this question and that their solution would not work in my case. In particular, one of my signals has noisy spiky behavior in addition (i.e., very sharp and large localized peaks due to sensor technical issues). Therefore the dividing of one of the samples by the sample magnitude is not going to lead to a good alignment of the two signals. Is the MSE difference approach mentioned by
robert-bristow-johnson in the comment the best approach then?


texts: Carrier frequency offset (CFO) estimation using cyclic prefix

texts:
I understand the cyclic prefix, but in (1) it's said that: "If we consider that the channel effect is minimal and can be neglected. then the phase difference of the CP and the OFDM symbol which the victim of CFO can be found by $2\pi\beta N/N= 2\pi\beta$." and then, the author derives the equation for estimating the CFO $\beta$. My questions are:

How is this phase difference between the cyclic prefix (CP) and the corresponding rear part of an OFDM symbol obtained?
I'm confused about how the cyclic prefix is used to estimate the carrier frequency offset. Can you explain how the formula for $\beta$ is derieved?

Reference

(1)
W.aziz, E.Ahmed, G.Abbas, S.Saleem, Q.Islam, "Performance analysis of carrier frequency offset (CFO) in OFDM usign MATLAB", Journal of Engineering, Vol. 1,No.1, 2012


texts:
let us suppose that we have given following model

$y(t)=A_1 \sin(\omega_1*t+\phi_1) + A_2 \sin(\omega_2*t+\phi_2) + A_3 \sin(\omega_3*t+\phi_3)+ \ldots +A_p \sin(\omega_p*t+\phi_p)+z(t)$

where  $z(t)$ is white noise,we have everything unknown,$p,A_i,\omega_i,\phi_i$,what i want to remove noise using wavelet,i know that is it  possible using discrete wavelet,so which mother waveelt is good for deterministic and  periodic components?let us suppose that we have  data  ,some numbers of length $N=294$,which mother wavelet should i choose and  which scales?please help me with practical example,because wavelet is new and i want to see what is steps for denoising,there is some link about denosing

http://eeweb.poly.edu/iselesni/DoubleSoftware/signal.html

including matlab codes,but i want to know before i start use some method  ,is it relevant for such model?as i know wavelet is good for transient signals,is it ok for steady signals?for periodic ones?if so then which steps is necessary?thanks in advance


texts: Find the difference equation and draw the simulation diagram

texts:
Calculate the difference equation and then draw the simulation diagram of the below transfer function.
  $$
H(z) = \frac{Y(z)}{X(z)} = \frac{0.4142 + 0.4142z^{-1}}{1.4142 - 0.5858z^{-1}}
$$

I performed the normal procedure to find the difference equation, by cross multiplying and using the delay property of the $\mathcal Z$-transforms, I finally ended up with:

$$y[n] = 0.2929 x[n] + 0.2929 x[n-1] + 0.4137 y[n-1]$$

How do I draw the simulation diagram?

I want to know how to draw the block diagram of the difference equation.

I will try to draw the diagram but I am not sure if it is correct.

I don't require the answer but guidance on how to derive the diagram and final answer.

This is what I have done,

I have attached my solution.

is this correct?

I have modified my answer again.


texts: Inverse z transform - Pair of complex conjugate poles

texts:
How can I perform the inverse z-transform on the following $H(z)$ to be able to calculate a real-valued impulse response $h[n]$?
$$
H(z)=\frac{z^2}{z^2+0.8\sqrt{2}z+0.64}
$$
My idea was to find an inverse z-transform on my list of transformations, which basically does what I want with a similar transfer function (nothing too special about that idea). Well, I found the following:
$$
H(z)=\frac{p z \sin(\alpha)}{z^2-2p z \cos(\alpha)+p^2}
$$
I then tried to adjust the transfer function. First I did that for the denominator and found it had a pair of complex conjugate poles $0.8e^{+j\frac{3\pi}{4}}$, and $0.8e^{-j\frac{3\pi}{4}}$. That seems great, my desired form of the transfer function has similar poles $pe^{+j\alpha}$, and $pe^{-j\alpha}$. Therefore I would substitute $p=0.8$ and $\alpha=\frac{3\pi}{4}$. But now I don't know how to go further, what do I do with the numerator? Is this approach valid at all?


texts: How does noise reduction for speech recognition differ from noise reduction that is supposed to make speech more "intelligible" for humans?

texts:
this is a question that has interested me for some time now, mainly because I'm working on noise reduction for an existing speech recognition system myself.

Most papers on noise reduction techniques seem to focus on how to make speech more intelligible for humans, or how to improve vague terms like "speech quality".

I'm sure that, using criteria like these, you can identify filters that make noisy speech signals easier to listen to for humans.
However, I am not sure that these criteria can simply be adapted when trying to evaluate speech signals that have been denoised to improve the accuracy of speech recognition system.

I don't really find papers that discuss this difference. Do speech intelligibility and speech quality correlate with the accuracy of speech recognition systems? Are there objective measures that can evaluate how "good" a denoised speech signal will be for a speech recognition system, for example if also given the original clean speech? Or is the only way to find out how good your noise reduction technique is, to train the speech recognition system on the denoised data and look at the accuracy?

I'd be happy if someone could point me into the right direction, or maybe give some papers that discuss this. Thanks in advance!


texts:
U.S. Broadcast FM stereo includes a $19\textrm{ kHz}$ pilot tone that needs to be frequency doubled to help demodulate the DSB stereo difference signal.

How can this frequency doubling be done digitally?
What signal paths need to be delay matched (etc.) to avoid phase errors causing loss of stereo separation?


texts: Generate the Convolution Matrix of 2D Kernel for Convolution Shape of `same`

texts:
I want to find a convolution matrix for a certain 2D kernel $ H $.
For example, for image Img of size $ m \times n $ , I want (in MATALB):

T * Img = reshape(conv2(Img, H, 'same'), [], 1);

Where T is the convolution matrix and same means the Convolution Shape (Output Size) matched the input size.

Theoretically, H should be converted to a toeplitz matrix, I'm using the MATLAB function convmtx2():

T = convmtx2(H, m, n);

Yet T is of size $ (m+2) (n+2) \times (mn) $ as MATLAB's convmtx2 generates a convolution matrix which matches Convolution Shape of full.

Is there a way to generate the Convolution Matrix which matches using conv2() with the same convolution shape parameter?


texts: What are some of the differences between DFT and FFT that make FFT so fast?

texts:
I'm trying to understand FFTs, here's what I have so far:

In order to find the magnitude of frequencies in a waveform, one must probe for them by multiplying the wave by the frequency they are searching for, in two different phases (sin and cos) and averaging each.  The phase is found by its relation to the two, and the code for that is something like this:

//simple pseudocode
var wave = [...];                //an array of floats representing amplitude of wave
var numSamples = wave.length;
var spectrum = [1,2,3,4,5,6...]  //all frequencies being tested for.

function getMagnitudesOfSpectrum() {
   var magnitudesOut = [];
   var phasesOut = [];

   for(freq in spectrum) {
       var magnitudeSin = 0;
       var magnitudeCos = 0;

       for(sample in numSamples) {
          magnitudeSin += amplitudeSinAt(sample, freq) * wave[sample];
          magnitudeCos += amplitudeCosAt(sample, freq) * wave[sample];
       }

       magnitudesOut[freq] = (magnitudeSin + magnitudeCos)/numSamples;
       phasesOut[freq] = //based off magnitudeSin and magnitudeCos
   }

   return magnitudesOut and phasesOut;
}

In order to do this for very many frequencies very quickly, FFTs use many tricks.

What are some of the tricks used to make FFTs so much faster than DFT?

P.S. I have tried looking at completed FFT algorithms on the web, but all the tricks tend to be condensed into one beautiful piece of code without much explanation.  What I need first, before I can understand the entire thing, is some introduction to each of these efficient changes as concepts.

Thank you.


texts: How to convert CIE xy value to gray scale value

texts:
Is there a way CIE chromaticity coordinates to gray scale value (0 to 255)?
Any existing implementation in ImageJ, R or Python?
Or formula?
Here is the table taken from here.

Purpose Description
To respond to Marcus's comment below.
I have two color images taken under certain light condition (say F10).
What I want to do is to correct those images at the gray scale level (0-255),
such that those two are directly comparable.
So I want to use the given x2,y2 CIE values for F10 as base to correct them.
That's why I want to have those x2,y2 as gray scale.
Please advice if you have better way to approach this.


texts: What is the most efficient way to perform Gaussian blurs for varying sizes of Gaussian kernels in an image?

texts:
I have detected corner points of images using Harris corner detector in GLSL and now, I intend on using Fast Retina Keypoint(FREAK) as keypoint descriptor to later match the keypoints between images.

FREAK uses circular sampling pattern, where each circles represent Gaussian kernels applied to the corresponding sampling points.

And, the size of Gaussian kernel increase exponentially for points farther away from central keypoint. I previously used nine hit Gaussian blur as mentioned here. So, what is the most efficient way to perform Gaussian blurs for a number of Gaussian kernels with varying sizes, which also overlap themselves, in an image?


texts: What is the beneficient of taking the FFT of an ecg signal?

texts:
Our teacher gave us a homework.
He says first find an ecg signal, then take FFT of that signal?

Why do we need to take FFT of an ecg signal? Is it that we can cancel noise only if we know the frequency spectrum of the signal?


texts: Eigenfunction of LTI causal system Z-transform

texts:
I am studying for my DSP final and I came across this question from the Oppenhiem and Schafer book 3rd edition. The question says

  3.18 A casual LTI system has the system function

  $$H(z)=\dfrac{1+2z^{-1}+z^{-2}}{\left(z+\frac{1}{2}z^{-1}
> \right)\left(1-z^{-1} \right)} $$

  (a) Find the impulse response of the system, $h[n]$

  (b) Find the output of this system, $y[n]$, for the input

  $$x[n]=e^{j(\pi/2)n} $$

For the first part, I got
$$h[n] =  -2 \delta[n]+\frac{1}{3}  \left(\frac{-1}{2}\right)^2 u[n]+\frac{8}{3} u[n]$$

which matches the answer at the back of the book, but the second part is difficult. We are asked to find the function $y[n]$ if $x[n] = 2^n$

I know that $2^n$ is an eigenfunction of $y[n]$, but I am not sure how to substitute it in $H(e^{j\omega})$. The answer at the back of the book is $y[n] = \frac{18}{5} 2^n$

Can anyone help me? Thanks in advance


texts: Window functions and indexes larger than N/2

texts:
How does the n index for a window with $0 \le |n| \le N/2$ e.g the Bohman window function, get implemented when having a specific window size?

if (n >= 0 && n <= N/2)

what happens with the passed in index e.g. 1000 of a 1024 window size ?


texts:
I have implemented a moving average filter (in Python) where I fill a list with values and average them. When new values arrive the oldest will be deleted.

Now I am wondering how much delay I get with this filtering.

I am sampling a sensor signal (voltage) with 1000 Hz and I have read often that the group delay (for my understanding that is the delay?) for a moving average filter for M values (window size) is (M-1)/2.

I can't really understand it because:

Lets say I have the a window size of 5 and following measured values arriving in my empty moving average filter:

6x 1 Volt
6x 3 Volt

|1|1|1|1|1|1|3|3|3|3|3|3|

First I am waiting until my moving average filter is filled (until the fifth measured value).

Then I get these average values

|1|1|1|1|1| 1 |3|3|3|3|3|3|   1   [1,1,1,1,1]
|1|1|1|1|1|1| 3 |3|3|3|3|3|  7/5  [1,1,1,1,3] <- 3 Volt first time measured
|1|1|1|1|1|1|3| 3 |3|3|3|3|  9/5  [1,1,1,3,3]
|1|1|1|1|1|1|3|3| 3 |3|3|3| 11/5  [1,1,3,3,3]
|1|1|1|1|1|1|3|3|3| 3 |3|3| 13/5  [1,3,3,3,3]
|1|1|1|1|1|1|3|3|3|3| 3 |3| 15/5  [3,3,3,3,3] <- 3 Volt average

I would expect that my delay would be (M-1)/2 = (5-1)/2 = 2 measurements
but I get my 3 volts in my moving average filter just after 4 more measurements (so delay M-1).

I would be very happy if someone could explain how I can determine my delay.


texts: Continuous wavelet transform subsampling at lower frequencies?

texts:
I am not completely confident in my understanding of wavelet theory, but since I am currently in the process of creating a CWT scalogram tool, I have to ask:

Is there a theorem allowing us to subsample at low frequencies and obtain correct scale/frequency results?


texts: artifact identification in irregular-samped data

texts:
There is a dataset combined by different datasets a,b,c,d,e. The time intervals are irregular(i1, i2, i3:intervals between a and b, b and c...), but the sampling rate SR in every single dataset is the same.

Because of these irregular intervals i1&i2&i3..and SR, which kind of artifact/alias would be generated in periodicity detection of the combined dataset?