applying the Parsen Window using a specific frequency for the width estimation

4 views (last 30 days)
Hello, I would like to estimate Parsen window of 0.1Hz This value is used to smooth the Fourier Amplitude. However, I realized that it provides a higher smoothing effect that can alter the amplitudes compared to the unmoothed FAS of the signal (attached as txt file). I found out the following to estimate the Parsen window: signal=load(signal.txt); window_width_Parsen=0.1; % 0.1Hz suggested that does not alter the amplitudes compared to the unmoothed FAS fs: 200 % Sample frequency of the signal and the FAS w_Parsen=(1/window_width_Parsen)*fs; w_Parsen=round(w_Parsen,0);

Accepted Answer

Animesh
Animesh on 29 Apr 2024
Edited: Animesh on 29 Apr 2024
To implement a smoothing operation using a Parzen window of width 0.1 Hz on the Fourier Amplitude Spectrum (FAS) of a signal, the parzenwin function can be of help.
First, we need to compute the Fourier Transform of the given signal. This can be done using the fft function available in MATLAB. Then, we apply the Parzen window for smoothing.
Here's how you can find the Fourier Transform:
fs = 200; % Sampling frequency
N = length(signal); % Number of points in the signal
f = fs * (0:(N/2)) / N; % Frequency vector
signal_fft = fft(signal);
signal_fft_amplitude = abs(signal_fft / N); % Amplitude spectrum
Here's how you can create a Parzen window:
window_width_Parzen = 0.1; % Hz
w_Parzen = (1 / window_width_Parzen) * fs;
w_Parzen = round(w_Parzen, 0); % Ensure it's an integer
parzen_window = parzenwin(w_Parzen * 2 + 1); % The Parzen window function requires an odd length
parzen_window = parzen_window / sum(parzen_window); % Normalize
Moreover, during the smoothing of any curve, there will be an alteration in the amplitude. We can use Root Mean Square Error (RMSE) to find the difference between the original and smoothed signal amplitudes. To minimize this alteration, you might need to adjust the window width. We can iteratively try to find the window width that minimizes the RMSE.
You can refer the following MathWorks documentation for more information:

More Answers (0)

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!