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

📄 fftpower.m

📁 FPGA输出数据的时频域分析GUI界面
💻 M
字号:
function [y,freq] = fftpower(x,startpoint,endpoint,fs,varargin)
%FFTPOWER calculate the fft power spectrum density data.
%   y = fftpower(x,startpoint,endpoint,fs), x could be real or complex,
%   (endpoint-startpoint+1) is the FFT point. fs is the sample frequency.

%   Author:Harrison Zheng
%   ShenZhen HYT Science&Technology CO.,LTD.
%   Date:2006.12.22
if (startpoint>=endpoint)
    error('start point could not be larger than end point');
end
[m,n] = size(x);
if ~(m==1 || n==1)
    error('input signal should be one dimension vector');
end
x = x(:);
fftpoint = endpoint - startpoint + 1;
y = abs(fftshift(fft(x(startpoint:endpoint),fftpoint)));
y = y(:);
freq = [-fs/2:fs/fftpoint:fs/2-fs/fftpoint]';

% End of Function

⌨️ 快捷键说明

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