fftplot.mht

来自「FFT」· MHT 代码 · 共 31 行

MHT
31
字号
From: <由 Microsoft Internet Explorer 5 保存>
Subject: 
Date: Mon, 11 May 2009 19:48:41 +0800
MIME-Version: 1.0
Content-Type: text/html;
	charset="gb2312"
Content-Transfer-Encoding: 7bit
Content-Location: http://www.mathworks.com/matlabcentral/fx_files/1249/1/fftplot.m
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.5726" name=GENERATOR></HEAD>
<BODY><PRE>%FFTPLOT(in)
%   This function plots the power spectrum on the input vector.
%   The coding was altered slightly from the demo that comes with
%   Matlab, but here it is in one easy-to-use file.

function out = fftplot(in)

a = fft(in);
a(1) = [];
b = length(a)/2;
power = abs(a(1:b)).^2;
nyq = 1/2;
freq = (1:b)/b*nyq;
plot(freq,power);

out = 'Done';</PRE></BODY></HTML>

⌨️ 快捷键说明

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