fsresize.m

来自「Matlab 6.0图形图像处理所附带的光盘」· M 代码 · 共 32 行

M
32
字号
function [y,iy]=fsresize(kn,n)%FSRESIZE Resize a Fourier Series.% FSRESIZE(Kn,N) resizes the complex exponential FS Kn to% have N harmonics. If N is greater than the number of% harmonics in Kn, zeros are added to the result.% If N is less than the number of harmonics in Kn, the% result is a truncated version of the input.%% FSRESIZE(Kn,Un) resizes the complex exponential FS Kn to% have the same number of harmonics as the FS Un.%% [Yn,iy]=FSRESIZE(Kn,N) additionally returns the harmonic% index of the result.% D.C. Hanselman, University of Maine, Orono, ME 04469% 1/12/95% Copyright (c) 1996 by Prentice-Hall, Inc. m=length(kn);N=length(n);if N>1, n=(N-1)/2; endnkn=(m-1)/2;	% number of harmonics in knif n>=nkn  zpadd=zeros(1,n-nkn);  y=[zpadd kn(:).' zpadd];else  no=nkn+1;		%index of DC harmonic  y=kn(no-n:no+n);endm=(length(y)-1)/2;iy=-m:m;

⌨️ 快捷键说明

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