声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2049|回复: 6

[综合讨论] 【求助】关于STFT 和WVD的仿真

[复制链接]
发表于 2011-5-28 10:33 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
跪求啊   谢谢   着急啊
这是我在网上下的两个程序,运行后貌似少了信号源还是 什么 ?求高手看下,求指导。
STFT部分:  三个怎么设
function [T,F,SP] = STFT(D,M,fm);

% y: input signal
% D: the data matrix: D(:,1)=t; D(:,2)=y;
% M: the lenght of the FT window


% [0 fm] The Frequency range for the signal
% SP: the spectogram (short time fourier transform) of D

%fm % the maximum freq

t=D(:,1);y=D(:,2);
N=length(y);

W=hanning(M);
ye=zeros(N+M,1);
ye(M/2+1:M/2+N)=y;
%yea=hilbert(ye);
dt=t(2)-t(1);% time resolution
fs=1/dt; % the sampling frequency

df=fs/M; %frequency resolution
L=round(fm/df); % the index of the max freq.
f=[0:L-1]*df;

i=1;
while i<=N
   
   s=ye(i:i+M-1).*W;
   sa=hilbert(s);
   
   S=fft(sa);
   B(:,i)=S(1:L);
   i=i+1;% increase by one (next sample)
end

SP = (1/N)*abs(B.*B);
SP = SP/max(max(SP)); % normalize it
T  = t;
F  = f;



% mesh(T,F,SP)
% contour(T,F,SP)



还有一个是function [T,F,Z]=Wigner(D,fm)  



谢谢
回复
分享到:

使用道具 举报

发表于 2011-5-28 13:00 | 显示全部楼层
1.不喜欢重覆帖
2.信号源应该使用者输入
3.不是有输入的注解吗?
 楼主| 发表于 2011-5-28 23:04 | 显示全部楼层
回复 2 # ChaChing 的帖子

我是看到没人回我才发的        
我自己试了一个不行,所以请教下,你能给点什么建议吗?
发表于 2011-5-28 23:56 | 显示全部楼层
回复 3 # magic0elf 的帖子

求助完整格式:出错代码和出错提示
 楼主| 发表于 2011-5-30 11:24 | 显示全部楼层
回复 4 # ChaChing 的帖子

报错
??? Input argument "D" is undefined.

Error in ==> STFT at 11
t=D(:,1);y=D(:,2);
发表于 2011-5-30 14:00 | 显示全部楼层
感觉这是一个函数 是要自己编程调用的  直接是不能运行的

评分

1

查看全部评分

发表于 2011-5-30 14:34 | 显示全部楼层
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-21 13:43 , Processed in 0.053054 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表