from
Low pass filtration
by Stephen McGovern
Takes an input vector and removes frequencies that exceed a chosen value.
|
| [y]=hicut(fs, fcut, x)
|
function [y]=hicut(fs, fcut, x)
% [y] = HICUT(fs, fcut, x) takes an input column vector and removes
% frequencies that exceed the cut off frequency.
%
% fs = sampling frequency
% fcut = cut off frequency
% x = input column vector
%
% NOTE: The output vector is normalized such that the maximum absolute
% value is equal to one.
%
%Coded By: Stephen McGovern
N=pow2(nextpow2(x));
f=((0:N-1)/N)*fs;
H=ones(N,1).*(f<fcut)';
X=fft(x, N);
Y=X.*H;
y=real(ifft(Y, N));
y=y(1:1:N);
y=y/max(abs(y));
|
|
Contact us at files@mathworks.com