%% Filter White Gaussian Noise Signal With a Highpass Filter
% Create a highpass filter with default properties. 

HPF = dsp.HighpassFilter;
%% 
% Create a spectrum analyzer object.
%%
hSA = dsp.SpectrumAnalyzer('SampleRate',44.1e3,...
    'PlotAsTwoSidedSpectrum',false,'ShowLegend',true,'YLimits',...
           [-150 30],...
           'Title',...
           'Input Signal and Output Signal of Highpass Filter');
hSA.ChannelNames = {'Input','Output'};
%% 
% Implement |step| on |HPF| to filter the white Gaussian noisy input signal. 
% View the input and output signals using the spectrum analyzer.
%%
for k = 1:100
    Input = randn(1024,1);
    
    Output = step(HPF,Input);
    
    step(hSA,[Input,Output]);
end
%% 
% Copyright 2015 The MathWorks, Inc.
