zl程序教程

您现在的位置是:首页 >  后端

当前栏目

【MATLAB】通信信号调制通用函数 — 傅里叶变换

MATLAB通信 函数 信号 通用 变换 傅里叶 调制
2023-09-14 09:05:32 时间

目录

傅里叶变换


傅里叶变换

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:((N/2)*df-df);
sf = fft(st);
sf = T/N*fftshift(sf);