%% Highpass Filtering of Tones
% Create a signal sampled at 1 kHz for 1 second. The signal contains two tones, one at 50 Hz and the other at 250 Hz, embedded in Gaussian white noise of variance 1/100. The high-frequency tone has twice the amplitude of the low-frequency tone.

fs = 1e3;
t = 0:1/fs:1;

x = [1 2]*sin(2*pi*[50 250]'.*t) + randn(size(t))/10;

%
% Highpass-filter the signal to remove the low-frequency tone. Specify a passband frequency of 150 Hz. Display the original and filtered signals, and also their spectra.

highpass(x,150,fs)

% Copyright 2012 The MathWorks, Inc.