how to implement hanning window with 50% overlap
Ältere Kommentare anzeigen
Hi there, I have a .wav file whic is attached here. I wish to get the sound pressure level (dB SPL re:1uPa) from this file and plot it against it's frequency components. Can someone check if my code is correct or what I need to do if it isn't. And very importantly, I need to apply a 'hanning window' with 50% overlap to my data, how do I do that?. Thanks very much for the anticipated helpful reply. Below is my code. Cheers.
% This reads in the .wav file
[data Fs] = wavread('C:wil.wav');
T = 1/Fs; % Sample time
L = length(data(:,1)); % Length of signal
t = (0:L-1)*T; % Time vector
x = data(:,1);
subplot(3,1,1), plot(t,x)
title('Signal')
xlabel('time (Seconds)')
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(x,NFFT)/L;
f = Fs/2*linspace(0,1,NFFT/2+1);
% Plot single-sided amplitude spectrum.
subplot(3,1,2), plot(f,2*abs((Y(1:NFFT/2+1))))
title('Magnitude of FFT')
xlabel('Frequency (Hz)')
ylabel('Amplitude')
xlim([0 10000]);
% Plot FFT in dB
subplot(3,1,3), plot(f,-10*(log10(abs((Y(1:NFFT/2+1)).^2))))
title('FFT in dB')
xlabel('Frequency (Hz)')
ylabel('Amplitude (dB)')
xlim([0 1000]);
Antworten (2)
Ryan
am 1 Nov. 2025
0 Stimmen
So im applying a Hann window to a 2d range image of .las point cloud. Current window overlapping is 50% could this result in smearing the range image? see 3d point cloud and resulting range image, my only other thought is that my projection may still be incorrect.

Kategorien
Mehr zu Descriptive Statistics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!