Clear Filters
Clear Filters

need some help with implementting a lpf filter

1 view (last 30 days)
hello everyone,
In the attached time-domain signal i want to filter a noise which exists somewhere in 2.25 seconds . My goal is to get as close as clean Rectangle with a clear and sharp rise.
Searching after the noise location, i looked after the FFT of the signal , expecting to get a sinc signal in the Freq-domain (Rectangle in time-domain equals to sinc in frequency-domain). After i did it, i guessed (after some computation with myself) that the noise is from 0.8*pi and on.
My problem is implementing that filter. can someone help me please ?
thanks a lot.
  1 Comment
Image Analyst
Image Analyst on 14 Jan 2014
Nothing is attached. Make sure you click the Attach file button after you click the Choose file button.

Sign in to comment.

Answers (2)

Image Analyst
Image Analyst on 10 Jan 2014
Edited: Image Analyst on 10 Jan 2014
The FT of a single rect is a sinc. You don't have that. You have two rects plus a step. What do you think the FT of that will be?
Anyway, the way to get a sharp digital signal output is simply
goodSignal = 0.04 * double(badSignal > 0.02);
No need for fft or anything. Why make it harder than it needs to be!?!?
  2 Comments
Image Analyst
Image Analyst on 10 Jan 2014
kobi's "Answer" moved here since it is not an answer to the original question but actually a reply to me:
hi and thanks for the quick answer.
What is the meaning of that code : goodSignal = 0.04 * double(badSignal > 0.02); ? why to multiply by 0.04 ? what's that "badSignal > 0.02" suppose to mean ?
i don't understand the reason behind it...
Image Analyst
Image Analyst on 10 Jan 2014
This is super basic stuff so if you read the "Getting started" section of the help you'll learn a lot more essential things like this. In the meantime,
badSignal > 0.02
means that your signal, which I'm assuming has been read in and stored in a variable called badSignal, is compared to 0.02. This will create a logical vector - a 1-D list with the same number of elements as badSignal where the value is either true or false depending on whether is is more than 0.02 or not.
Then I pass that into double() so that the vector of [false, false, true, true, .....] is converted into a double vector of [0.0, 0.0, 1.0, 1.0, .....].
Then we have a digital signal where the signal is exactly 0 or 1 depending on whether the noisy badSignal is lower or higher than 0.02. But you don't want it to have a value of 1 at the tops, you want a value of 0.04 , so I multiply the signal by 0.04. All the zeros remain zero since 0.04 * 0 = 0, but all the 1's change into 0.04 since 0.04 * 1 = 0.04. So a signal that was [0.0, 0.0, 0.04, 0.04, .....]
That's about as high a level of explanation detail I can think of, so I hope you followed it and understand it.

Sign in to comment.


kobi
kobi on 14 Jan 2014
Edited: kobi on 14 Jan 2014
i unsterstand your idea but i need to design a lpf filter in order to get signal close enough to rectangle...
do you have an idea to such an lpf ?
  1 Comment
Image Analyst
Image Analyst on 14 Jan 2014
You can either try filtering with a box of varying widths until the spikes are suppressed to your satisfaction, using imfilter() or conv2(), or you can zero out the high spatial frequencies and keep dropping the cutoff frequency until the spikes in the time domain go away to your satisfaction.

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!