Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Implementation low pass filter on array

  1. Nov 1, 2012 #1
    hi guys:

    if i have signal(YT) consist of two frequencies(30 and 300 Hz),as the following:

    Code (Text):




    i want remove the frequency of 300 Hz from(YT) by using low pass filter

    so how can i do that(by using matlab command)?
    Last edited: Nov 1, 2012
  2. jcsd
  3. Nov 1, 2012 #2


    User Avatar
    Science Advisor

    Do you want to use an analog or a digital filter?

    The basic steps would be:

    1. Design your filter. (Get the coefficients for your implementation, either digital or analog).

    2. Simulate your filter performance when fed with the data "YT". (Use the command "filter" to simulate a digital filter and for example 'lsim' for an analog filter).

    BTW. This looks like homework. What have you done so far?
  4. Nov 1, 2012 #3
    digital filter( for signal similar audio signal )

    how can i do that,?
    plz explain more


    i have a project (to make PC read ECG signals) this project need low pass filter to remove noise
  5. Nov 1, 2012 #4


    User Avatar
    Science Advisor

    Do you currently know anything about filter design?

    There are many way to design a filter, but here is a very simple example based on a first order continuous time LPF with cut off at 30 Hz. This is just an example to show how to use the matlab commands, you'll probably need a better filter than this.

    Code (Text):

    % Set up time base (sample period = 0.0005).
    dt = 0.0005;
    t =[ 0:dt:0.5];

    % Set up signal

    % Take a look at the signal + noise.

    % Construct very simple example continuous time filter ("s" domain ).
    nums = [1];
    dens = [1/60/pi, 1];

    % Bilinear conversion to a digital filter ("z" domain).
    [numz,denz] = bilinear(nums,dens,dt);

    % Run the data through the above designed filter.
    YTfilt = filter(numz,denz,YT);

    % Take a look at the results.
    Last edited: Nov 1, 2012
  6. Nov 1, 2012 #5
    thank you very much uart for this code:smile:
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook