MATLAB 10Hz High Pass filter with Matlab

AI Thread Summary
The discussion revolves around creating a 10Hz high pass filter in MATLAB to analyze force measurements from a foam rubber fingertip pressing a keyboard. The user, Jeremy, is experiencing an offset in the force curve and seeks advice on filtering the signal or alternative solutions. Suggestions include starting with a lower filter order to avoid data distortion and using the 'butter' command as an alternative to 'fir1'. Additionally, there is a note that the cutoff frequency in the 'fir1' command may need to be interpreted in radians per second rather than Hertz. The conversation emphasizes the importance of proper filter design to achieve accurate results.
leonpolou
Messages
1
Reaction score
0
Hi everyone,

here is the problem:
I am trying to reproduce a human finger while pressing a keyboard.
I am using a shaker and a fingertip made of foam rubber. To measure the force history, a force gage make a link between the fingertip and the shaker.
The fact is the curve has an offset and I try to know why.

A solution might be that we use the force gage at a 5.8Hz and that material is usully use with frequency upper than 10 Hz.
To solve that problem a basic solution would be to filter the signal recorded with an high pass filter.
Actually I really don't know how to do it.

here is my code on matlab
f=10; %Cut off frequency%
fs=42000; %resolution frequency%
w=f/(fs/2); % frequency normalized%
N=100; &filter order%
b=fir1(N,w,'high');
figure(1);
freqz(b,1,42000,fs); % we see how the filter look like%
y=fftfilt(b,X1(1:65536,2));
figure(2);
plot(X1(1:65536,1),y,'r',X1(1:65536,1),X1(1:65536,2))


First, how do you think is it possible to make a 10Hz high pass filter with matlab

Second, if you have some idea to solve my problem while using other thing than filter the signal, that would be a pleasure for me.

Regards
jeremy
 
Physics news on Phys.org
I'm not familiar with the MATLAB command fir1(), but here are some thoughts:

100 is a pretty high order for a filter. I would recommend starting with N = 1 and step up one order at a time until you get something you like. High orders might tend to distort your data very badly.

The cutoff frequency (as interpreted by the fir1 command) is likely to be in radians/sec, not Hz. Like I said, I have no experience with this, so you should check the documentation to be sure.

Hope this helps,

Kerry
 
you can use butter command.
 

Similar threads

Replies
4
Views
3K
Replies
5
Views
6K
Replies
10
Views
3K
Replies
11
Views
3K
Replies
4
Views
4K
Replies
1
Views
2K
Replies
27
Views
3K
Replies
1
Views
3K
Back
Top