ideal low-pass filter transfer function

37 views (last 30 days)
i have a signal in frequency domain (that i made fft and fftshift before) and i need to multiply it by a transfer function of an ideal low-pass filter with bandwith around 25Hz. i can't use the lowpass function and i need to only use the simplest basic functions.
so since it is an ideal low-pass filter, i was thinking multiply my signal with a rectangular signal in frequency domain. but my question is i don't know how to write a rectangular signal transfer function in frequency domain. Any recommendations? Thank you.

Accepted Answer

Star Strider
Star Strider on 10 Jan 2020
The ‘ideal’ filter is symmetrical about the origin in the frequency domain (after doing the fftshift call), so will be 1 from -25 Hz to +25 Hz, and zero elsewhere. Define it as such, and then do the multiplication with the signal in the frequency domain. Then use ifftshift on the filtered signal, then ifft to return it to the time domain.
Be sure to scale the result correctly, since filtering removes much of the energy in the original signal.
  2 Comments
Claire Bassem
Claire Bassem on 10 Jul 2021
Hi i have the same exact problem as this one and i tried to follow through your steps but I'm facing some problems. first i defined the ideal LPF as a piecewise function as follows:
pw=piecewise((-25<x1)&(x1<25),1, 0);
and assuming my signal in frequency domain after fft and fftshift is called ftxs, i tried to multiply it by the piecewise function as follows
mul=pw.*ftxs
but when i try to plot it to make sure the shape is correct, i get this error:
Error using plot
Data must be numeric, datetime, duration or an array convertible to double.
and consequently if i try to get its ifft and plot it it gives out the same error.I'm guessing it has something to do with the piecewise function but i can't seem to fix it.
any advice would be of great help. thanks.
Star Strider
Star Strider on 10 Jul 2021
I can’t offer any advice. I don’t understand the problem.
This would best be posted as a new Question, with significantly more information.
I will delete these Comments from this thread in a few hours.

Sign in to comment.

More Answers (1)

Ismail Ata Yavuz
Ismail Ata Yavuz on 10 Jan 2020
Once again thank you so much Mr Polar Bear :) I started to question myself that you might be my professor :)

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!