Filter löschen
Filter löschen

How do I Broaden Peaks in the Frequency Domain?

9 Ansichten (letzte 30 Tage)
Lance Ta
Lance Ta am 28 Jun. 2023
Beantwortet: Keerthi Reddy am 30 Jun. 2023
Hello,
I have created a time varying signal made up of sinusoids of different frequencies, as shown in the code below.
% Generate the timestep and signal period
tStep = 0.001;
x = 0:tStep:1;
% Set the DC value of the target
DC_temp = 388.659944729366;
% Create the AC frequencies
AC_freq1 = DC_temp*.05*sin(2 * pi * 20*x);
AC_freq2 = DC_temp*.03*sin(2 * pi * 25*x);
AC_freq3 = DC_temp*.08*sin(2 * pi * 60*x);
AC_freq4 = DC_temp*.08*sin(2 * pi * 200*x);
% Create the target as the DC temp + AC frequencies
target = DC_temp+AC_freq1+ AC_freq2+AC_freq3+AC_freq4;
% Normalize the target signal so that the average is still the DC value
target_DC_diff = mean(target) - DC_temp;
target = target - target_DC_diff;
When I take the fft, I will get the following spikes in the frequency domain as expected. I want to apply some effect to the time varying signal in order to broaden each of the peaks in the fft over some extended frequency bin/range. For example, the peaks at 20 and 25 Hz would overlap with each other, making it harder to resolve between the two, though you may still see the peaks depending on how much of the effect is applied.
How would I accomplish this? I'm aware that you can multiply the time signal by a sinc function, but I would like to avoid going this route because of how it affects the time domain signal.
Thank you in advance for any help that you can provide.

Akzeptierte Antwort

Keerthi Reddy
Keerthi Reddy am 30 Jun. 2023
Hi Lance, as you want to broaden the frequency domain without directly multiplying the time signal by a “sinc” function, you can use a windowing function. One popular windowing function that can be used to broaden the peaks is the Gaussian window. You can apply the Gaussian window to your time-varying signal before taking the FFT. Here is a snippet which shows how to apply a gaussian function.
% Apply the Gaussian window
window = gausswin(length(target));
target_windowed = target .* window';
By applying the Gaussian window to your time-varying signal before taking the FFT, you should see the peaks in the frequency domain broaden, making it harder to resolve between the individual frequencies.
You may refer the following documentation for more information: Gaussian window - MATLAB gausswin - MathWorks India
Hope this helps.

Weitere Antworten (0)

Produkte


Version

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by