⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 t2f.m

📁 北邮《通信原理基于Matlab的计算机仿真》书的源码 m文件 好不容易弄来的
💻 M
字号:
function [f,sf]= T2F(t,st)
%This is a function using the FFT function to calculate a signal's Fourier
%Translation
%Input is the time and the signal vectors,the length of 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/2:df:N/2*df-df/2;
f=-N/2*df:df:N/2*df-df;

sf = fft(st);
sf = T/N*fftshift(sf);

%dff = df/8;
%ff = -50*df:dff:50*df;
%mf = sinc(ff*T);
%sf = conv(mf,sf)

%NN = length(f)+length(ff)-1;
%f = -NN/2*dff:dff:NN/2*dff-dff;


⌨️ 快捷键说明

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