Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
low pass filter: strange behaviour

Subject: low pass filter: strange behaviour

From: pietro

Date: 28 Sep, 2012 15:01:08

Message: 1 of 2

Hi all,

I want to derive the speed from a measured acceleration with numeric integration and I tried to remove the drift through a high pass filter.

here my code:
vel_rel=cumtrapz(run(i).t,acc_rel);
Fs = 40; % Sampling Frequency

Fstop = 0.05; % Stopband Frequency
Fpass = 0.2; % Passband Frequency
Astop = 80; % Stopband Attenuation (dB)
Apass = 1; % Passband Ripple (dB)
match = 'stopband'; % Band to match exactly

% Construct an FDESIGN object and call its BUTTER method.
h = fdesign.highpass(Fstop, Fpass, Astop, Apass, Fs);
HP_filter= design(h, 'butter', 'MatchExactly', match);
vel_rel=filter(HP_filtro,vel_rel);

here you can see the integrated signal:
http://imageshack.us/photo/my-images/62/displacement.png/


and here the filtered one...
http://imageshack.us/photo/my-images/694/filtspeed.png/

why do I get this? I have done it several times in this way and it has always worked.

Thank you

Best regards

Pietro

 

Subject: low pass filter: strange behaviour

From: pietro

Date: 4 Oct, 2012 14:50:12

Message: 2 of 2

"pietro " <bracardi82@email.it> wrote in message <k44e3k$613$1@newscl01ah.mathworks.com>...
> Hi all,
>
> I want to derive the speed from a measured acceleration with numeric integration and I tried to remove the drift through a high pass filter.
>
> here my code:
> vel_rel=cumtrapz(run(i).t,acc_rel);
> Fs = 40; % Sampling Frequency
>
> Fstop = 0.05; % Stopband Frequency
> Fpass = 0.2; % Passband Frequency
> Astop = 80; % Stopband Attenuation (dB)
> Apass = 1; % Passband Ripple (dB)
> match = 'stopband'; % Band to match exactly
>
> % Construct an FDESIGN object and call its BUTTER method.
> h = fdesign.highpass(Fstop, Fpass, Astop, Apass, Fs);
> HP_filter= design(h, 'butter', 'MatchExactly', match);
> vel_rel=filter(HP_filtro,vel_rel);
>
> here you can see the integrated signal:
> http://imageshack.us/photo/my-images/62/displacement.png/
>
>
> and here the filtered one...
> http://imageshack.us/photo/my-images/694/filtspeed.png/
>
> why do I get this? I have done it several times in this way and it has always worked.
>
> Thank you
>
> Best regards
>
> Pietro
>
>

can't anyone help me?

thanks

Pietro

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us