Create a notch filter for complex input data

9 ビュー (過去 30 日間)
B P
B P 2015 年 8 月 12 日
回答済み: Billy Kihei 2021 年 1 月 22 日
I have a complex sampled signal where I want to filter out the signal at 244140 Hz with an Fs = 390625.
What I tried was:
% See the pic for what the signal looks like
d = fdesign.notch('N,F0,BW,Ap',200,0.625,0.045,1);
Hd = design(d);
y = filter(Hd,myComplexData);
But
  1. The notch didn't show up where I thought it would
  2. It is not complex
Now because it is not generating a filter with complex coefficients I understand why the notch is at where it is at.
My questions is: How do I create a complex coefficient filter?
  3 件のコメント
B P
B P 2015 年 8 月 12 日
Here is the pic:
B P
B P 2015 年 8 月 12 日
This is what the output looks like after filtering
You can see that there are two spots where the filter is attenuating. I only want the filter to filter out around the 320 bin.

サインインしてコメントする。

回答 (2 件)

Uladzimir
Uladzimir 2015 年 8 月 12 日
編集済み: Uladzimir 2015 年 8 月 12 日
Maybe it will help you
F = 244140;
Fs = 390625;
NFFT = length(YourSignal);%or 2^n
YourSpectra = fft(YourSignal,NFFT);
df = Fs/NFFT;% or, if your signal is complex, this must be a known parameter
Ns = round(F/df)+1;
ComplexHarmonic = 2*YourSpectra(Ns);
  2 件のコメント
B P
B P 2015 年 8 月 12 日
How does 2 x the frequency bin I am trying to filter help produce a complex valued filter?
Uladzimir
Uladzimir 2015 年 8 月 13 日
I just showed an idea with frequency transform. If you have already complex signal, 2x isn't needed, just in a case of fourier transform. You have a signal in a frequency domain. And need a value of one bin on the definite frequency. So, you just need to know the number of this bin.
Ns = round(F/df);
ComplexValue = ComplexSignal(Ns);

サインインしてコメントする。


Billy Kihei
Billy Kihei 2021 年 1 月 22 日
Multiplication in frequency domain is convolution in time domain. (this works for real or complex)
  1. Take x[t] -> fft -> Y[f]
  2. zero out the values in Y[f] you want to get rid of -> Ymanuallyfiltered[f]
  3. Ymanuallyfiltered[f]->ifft->x_filtered[t]
  4. x_filtered[t]->fft->Yfiltered[f]
Note: This may make your code take much longer to run, but it's a quick and dirty way without designing a filter. It is important that you convert it back to time domain after your manually editing. Then re-fft it to get the natural frequency of the response after filtering. Hope this helps.

カテゴリ

Help Center および File ExchangeArray and Matrix Mathematics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by