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

📄 tfplot.m

📁 QAM_MODEM matlab代码
💻 M
字号:
function tfplot(s, fs, name, plottitle)% TFPLOT Time and frequency plot%    TFPLOT(S, FS, NAME, TITLE) displays a figure window with two subplots.%    Above, the signal S is plotted in time domain; below, the signal is plotted%    in frequency domain. NAME is the "name" of the signal, e.g., if NAME is%    's', then the labels on the y-axes will be 's(t)' and '|s_F(f)|',%    respectively.  TITLE is the title that will appear above the two plots. %santosh shah, The LNM IIT Jaipur (India)(santosh.jnt@gmail.com) 20/04/07% Compute the time and frequency scalest = linspace(0, (length(s)-1) / fs, length(s));f = linspace(-fs/2, fs/2, length(s));% compute the FFTs_f = fft(s);figure;% First plot: timesubplot(2,1,1); plot(t, s);xlabel('t [s]'); ylabel(sprintf('%s(t)', name));title(plottitle);% Second plot: frequency% We use fftshift to move the coefficients for negative frequencies to the leftsubplot(2,1,2); plot(f, fftshift(abs(s_f)));xlabel('f [Hz]'); ylabel(sprintf('|%s_F(f)|', name));

⌨️ 快捷键说明

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