impelmentation of windowing a signal with very high overlap percentage

I am trying to manually implement stft,but i wanted to implement in such a way that the overlap of window is so large i mean to say if the window length is from 1 to 98 samples my overlap should be from 2nd sample to 99 samples i have created a code with using the basic functions not even considering the fft function of matlab also my algorithm was to calculate the fft of the windowed signal manually and later slide the window by deleting the 1st sample and then adding the 99th sample in my case. this is the code i have designed so far please help me from here as i have no idea from here.
fs = 5000;
t = (0:100)/fs;
omega1 = 2*pi*500;
w = hamming(98)';%window with length of 98
x = sin(omega1*t);%signal
e = length(x);
y = x(1:98).*w;% windowed signal
T = length(y);
N = length(y);
freq = (0:N-1)*fs/N;%frequency axis
output = zeros(size(x));
for k = 0:N-1
s = 0;
for n = 0 : N-1
s = s + x(n + 1).*w(n+1) .*exp(-2i * pi * n * k / N);%fft performed with windowing
Stotal = s - x(n+1)*exp(-2i * pi * n * 0 / N);%I have subtracted the 1st sample
end
output(k+1 ) = Stotal;
end

2 Kommentare

please format your code by highlighting it and pressing the {}code button
yaa I have done it now

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

raj
raj am 22 Dez. 2011

0 Stimmen

please suggest me if u have a complete different idea also....

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with Signal Processing Toolbox finden Sie in Hilfe-Center und File Exchange

Gefragt:

raj
am 22 Dez. 2011

Community Treasure Hunt

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

Start Hunting!

Translated by