t2f.m

来自「二进制数字调制信号ook,2psk,2fsk信号及其频谱」· M 代码 · 共 13 行

M
13
字号
function[f,sf]=T2F(t,st)    %计算信号的傅里叶变换
% this is a function using the FFT function to calculation a single's 
%Fourier translation 
%input is the time and the signal vectors,the length of the time must
%greater than 2;Output is the frequency and the signal spectrum
dt=t(2)-t(1);
T=t(end);
df=1/T;
N=length(st);
f=-N/2*df:df:N/2*df-df;
sf=fft(st);
sf=T/N*fftshift(sf);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?