fftseq() 50

%Matlabel demonstration script for DSP modulation. %The message signal is + for 0<t<t0/3,-1 for t0/3<t<2t0/3,and zero %otherwise. clear echo off t0=0.15; ts=0.001; fc=250; snr=10; fs=1/ts; df=0.3; t=(0:ts:t0); snr_lin=10^(snr/10... 展开
我有更好的答案
推荐于2016-01-09 08:16:13 最佳答案
%matlab面没fftseq()函数需要自编写编写M文件放程序目录
% MATLAB函数fftseq.m间序列m间隔ts要求频率辨率df作输入2序列
% 序列FFT(M)所要频率辨率
function [M,m,df]=fftseq(m,ts,df)
% [M,m,df]=fftseq(m,ts,df)
% [M,m,df]=fftseq(m,ts)
% FFTSEQ Generates M,the FFT of the sequence m.
% The sequence is zero-padded to meet the required frequency resolution df.
% ts is the sampling interval.The output df is the final frequency resolution.
% Output m is the zero-padded version of input m,M is the FFT.
fs=1/ts;
if nargin == 2
n1=0;
else
n1=fs/df;
end
n2=length(m);
n=2^(max(nextpow2(n1),nextpow2(n2)));
M=fft(m,n);
m=[m,zeros(1,n-n2)];
df=fs/n;
end

liayinhai

采纳率:100% 擅长: 暂未定制

为您推荐:

×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消