Implementation low pass filter on array

Click For Summary

Discussion Overview

The discussion revolves around implementing a low pass filter in MATLAB to remove a specific frequency (300 Hz) from a composite signal (YT) that contains two frequencies (30 Hz and 300 Hz). Participants explore different approaches to filter design and simulation, focusing on digital filtering techniques.

Discussion Character

  • Technical explanation
  • Homework-related
  • Exploratory

Main Points Raised

  • One participant asks how to remove the 300 Hz frequency from the signal YT using a low pass filter in MATLAB.
  • Another participant inquires whether an analog or digital filter is preferred, suggesting steps for filter design and simulation.
  • A participant specifies the use of a digital filter for an audio-like signal and requests further explanation on the implementation.
  • One participant provides a simple example of a first-order continuous time low pass filter with a cutoff at 30 Hz, including MATLAB code for filter design and simulation.
  • Another participant expresses gratitude for the provided code and acknowledges their understanding of filter design.

Areas of Agreement / Disagreement

Participants generally agree on the need for a low pass filter to remove the 300 Hz frequency, but there are varying opinions on the specifics of filter design and implementation methods. The discussion includes multiple approaches and no consensus on the best method is reached.

Contextual Notes

Participants mention the need for a better filter than the simple example provided, indicating that the initial approach may not be sufficient for all applications.

samaaa
Messages
48
Reaction score
0
hi guys:

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

Code:
t=0:1/1000:1;

Y30=sin(2*pi*t*30);

Y300=sin(2*pi*t*300);

YT=Y30+Y300;

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:
Physics news on Phys.org
samaaa said:
hi guys:

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

Code:
t=0:1/1000:1;

Y30=sin(2*pi*t*30);

Y300=sin(2*pi*t*300);

YT=Y30+Y300;

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)?

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?
 
uart said:
Do you want to use an analog or a digital filter?

digital filter( for signal similar audio signal )

uart said:
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 )

how can i do that,?
please explain more


uart said:
This looks like homework
No

i have a project (to make PC read ECG signals) this project need low pass filter to remove noise
 
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:
% Set up time base (sample period = 0.0005).
dt = 0.0005;
t =[ 0:dt:0.5];

% Set up signal
Y30=sin(2*pi*t*30);
Y300=sin(2*pi*t*300);
YT=Y30+Y300;

% Take a look at the signal + noise.
figure(1)
plot(t,YT)

% 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.
figure(2)
plot(t,YTfilt)
 
Last edited:
uart said:
Do you currently know anything about filter design?
yes

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:
% Set up time base (sample period = 0.0005).
dt = 0.0005;
t =[ 0:dt:0.5];

% Set up signal
Y30=sin(2*pi*t*30);
Y300=sin(2*pi*t*300);
YT=Y30+Y300;

% Take a look at the signal + noise.
figure(1)
plot(t,YT)

% 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.
figure(2)
plot(t,YTfilt)


thank you very much uart for this code:smile:
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 27 ·
Replies
27
Views
4K