alias.m
来自「很多matlab的源代码」· M 代码 · 共 32 行
M
32 行
function [fa,fd] = alias(f,fs)
% ALIAS Compuation of aliased frequencies.
%
% [FA,FD] = ALIAS(F,FS) Computes aliased frequencies
% F = frequency array in HERTZ, FS = sampling frequency in HERTZ.
% FA = aliased frequencies, FD = aliased DIGITAL frequencies (FD < 0.5)
%
% ALIAS (with no input arguments) invokes the following example:
%
% % Find the aliased frequencies if a signal with [100 200 300 400]Hz
% % is sampled at 120Hz
% >>[fn,fnd] = alias([100,200;300,400],120)
% ADSP Toolbox: Version 2.0
% For use with "Analog and Digital Signal Processing", 2nd Ed.
% Published by PWS Publishing Co.
%
% Ashok Ambardar, EE Dept. MTU, Houghton, MI 49931, USA
% http://www.ee.mtu/faculty/akambard.html
% e-mail: akambard@mtu.edu
% Copyright (c) 1998
if nargin==0,help alias,disp('Strike a key to see results of the example')
pause,[fn,fnd]=alias([100,200;300,400],120),return,end
if fs<=0, error('Sampling frequency must be positive'),return,end
fa=rem(f,fs);i=find(abs(fa)>0.5*fs);
if ~isempty(i),fa(i)=fa(i)-sign(fa(i))*fs;end
fd=fa/fs;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?