Matlab low-pass filter implementation and transfer function

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 30K views
philnev
Messages
2
Reaction score
0
Hey guys,

Basically, I have been doing some testing with regards to tactile vibrations (I know that isn't very electrical) and using a HET have developed several amplitude plots in the time domain. I've been sampling at 5000Hz and I want to remove the noise from my signals to leave me with a clean (hopefully!) sine wave. I then want to use this wave, along with another amplitude-time graph (basically a side profile of the sample used for testing) in order to produce a transfer function for the human finger. I undersrtand that Matlab can do this for me but I can't figure out how!

Sorry if I've posted this in the wrong area, can anyone help!?
 
Physics news on Phys.org
You don't say what type of filter or what cutoff frequency etc that you require? I'll give you an example anyway. Below is an IIR implementation of a 2nd order Butterworth LPF with 50Hz cutoff frequency.

Code:
fs=5000;                    % Sample Freuency
fn=fs/2;                    % Nyquist Frequency
fc=50;                      % Desired Cutoff frequency (example)
[b,a]=butter(2,fc/fn);      % IIR Filter coefficients, b=num, a=denom
xf=filter(b,a,x);           % apply filter to x

BTW. "filter" is an inbuilt function whereas "butter" (and other filter implementations) usually come with a signal processing toolbox. Both are available with a standard installation of gnu octave.
 
Last edited:
I knew I would forget to add something! The cut-off frequency is a little vague to me at the moment as I have not been able to ascertain the absolute frequency of the signal through FFT. Thanks very much for your reply though, it definitely helps with matlab!