how do i run my signal through a filter i designed with filter design tool

Asked by tajinder on 11 Jul 2012
Latest activity Answered by Honglei Chen on 11 Jul 2012

Hi. I am novice matlab user. I have what my be a simple question to more experienced users.

I am trying to remove the dc offset(0.16hz) from an eeg signal. Having constructed a high pass filter in the filter designer toolbox, i have generated mablab code and inserted in to my .m file.

my question is how do i pass my signal through it, so that i may plot my results.

Thanks

Code below :

load nikita2.mat nik= nikita (:,3);

%*function Hd = nikitaHighPass Fs = 128; % sampling frequency N = 1; % Order Fc = 0.16; % Cutoff Frequency

% Construct an FDESIGN object and call its BUTTER method. h = fdesign.highpass('N,F3dB', N, Fc, Fs); Hd = design(h, 'butter', 'FilterStructure', 'df1sos');

% Question how do i get the matrix 'nik' through the filter so that i can create figures?

figure; plot(h,'nik'); h_legend=legend('AF3'); set(h_legend,'FontSize',14); title('NIKITA' offset 0.16HZ removed]','FontWeight','bold'); xlabel('Time / 128 samples per second'); ylabel('microVolts');

0 Comments

tajinder

Products

1 Answer

Answer by Honglei Chen on 11 Jul 2012

Please format your code in your question. I'm not sure what you mean by

plot(h,'nik')

but if you want to filter the signal, nik, you can do

y = filter(Hd,nik)

0 Comments

Honglei Chen

Contact us