Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need Help about Spectrogram in DSP

Status
Not open for further replies.

TPORC

Newbie level 1
Joined
May 19, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,288
i've built a function to calculate the spectrogram, but there's always an error.

function [B ,T, F]=MySpectrogram(xx,Nfft,fs,window,Noverlap)
L=64
num_segs=ceil(Nfft/L)
B=zeros(Nfft/2+1,num_segs)
T=[]
F=[]
iseg=0
nstart=0
while (nstart+L-1<Nfft)
nstart=1+iseg*(L-Noverlap)
xsegw=window.*xx(nstart:nstart+L-1);
XX=fft(xsegw,Nfft)
T=[T,iseg*L/fs]

iseg=iseg+1
B:),iseg)=XX(1:Nfft/2+1)
end
for n=0:Nfft/2-1
F=[F fs/Nfft*n]

end

Is there anybody can do me a favor to check the matlab code?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top