谁有linear_fft.m

来源:百度知道 编辑:UC知道 时间:2024/09/20 02:53:01
谁有linear_fft.m
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;