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
采纳率:100% 擅长: 暂未定制