2
$\begingroup$

In order to truncate my signal in the frequency domain, I am applying a low pass filter with the windowing method. As a test, I chose the Hamming window. What is the cause of the oscillation at the bottom of the filtered signal? Also, it seems that the filter reduces the amplitude of the signal slightly. How can I get the same amplitude as the original signal after filtering? Is my filter functioning correctly? Since this is my first time using the filter, I may have made mistakes. I would greatly appreciate it if anyone could help.

sig = MY SIGNAL;
fs = 4000;                    % sampling freq. (GHz)
M = 400001;                   % signal length
% Filter parameters:
L = M;                         % filter length 
fcut = 1.5;                    % cutoff frequency (GHz) 
% Design the filter using the window method:
hsupp = (-(L-1)/2:(L-1)/2);
hideal = (2*fcut/fs)*sinc(2*fcut*hsupp/fs);
h = hamming(L)' .* hideal;                   % h is our filter
SIG_out = fft(sig);                          % signal
H = fft(h);                                  % filter
FILT_OUT = SIG_out .* H;                   
filt_out = ifft(FILT_OUT);
relrmserr = norm(imag(filt_out))/norm(filt_out) % check... should be zero
freqz(h, 1, 2^16, fs)
$\endgroup$

1 Answer 1

1
$\begingroup$

A few things are going on here

  1. Your bandwidth is very low compared to the sample rate. For a white input you would be removing 99.9%+ of the energy. Your signal is not white, but you are still removing energy
  2. Your impulse response is extremely long and non-causal. That's the post and pre ringing that you see.
  3. Multiplication in the frequency domain implements circular convolution (not linear convolution). That's why you get wrap around at the end
$\endgroup$
4
  • $\begingroup$ Thanks for your comments. Bandwidth is fixed. I am not able to change it. I didn't get what you mean by white input and removing energy. Do you have any suggestion to improve the result? $\endgroup$
    – Amy
    Commented Mar 11, 2022 at 21:20
  • $\begingroup$ In order to "improve" you need to define quantitative metrics of what "better" means. I f you want to maintain causality , use a minimum phase filter. If you don't want wrap around, use linear convolution. If you want less ringing, use a filter that's less steep. Filterng is all about trade offs. $\endgroup$
    – Hilmar
    Commented Mar 12, 2022 at 7:59
  • $\begingroup$ Your bandwidth is 3 GHz. But does your sample rate really have to be 4 THz? That's way more than any real world DAC or ADC can do $\endgroup$
    – Hilmar
    Commented Mar 12, 2022 at 8:00
  • $\begingroup$ My signal is the output of some analysis in my system and the sampling rate is what I have to consider at first for my simulations. So, yes, it has to be high. $\endgroup$
    – Amy
    Commented Mar 20, 2022 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.