Skip to main content
added 293 characters in body
Source Link
Dan Boschen
  • 55k
  • 2
  • 59
  • 143

I suspect the waveform is already down-converted to be a complex baseband signal, yet the plot has the carrier frequency arbitrarily added.

Instead of doing the following:

fft_freqs = np.linspace(sample_rate / -2, sample_rate / 2, 1024) + center_freq

Consider the frequency axis for the filter as:

fft_freqs = np.linspace(sample_rate / -2, sample_rate / 2, 1024) 

This will result in the normalized frequency range properly extending from $-0.5$ to $+0.5$ cycles/sample.

The function iirnotch is a real filter and thus will notch the same frequency from $f=0$ to $f=+0.5$ as $f=0$ to $f=-0.5$ cycles/sample, with $f=0.5$ cycles per sample corresponding to $w0=1$ for use in the iirnotch function. What you may actually have with the complex baseband signals is the need to notch individual frequencies which may not be complex conjugate symmetric, in which case a filter with complex coefficients is used, which can notch individual tones above or below the center frequency of the signal.

Please see DSP.SE #31028 for further details on implementing IIR notch filters. For an intuitive explanation on notch filters aimed toward those less familiar with signal processing, this YouTube interview may be of interest: https://www.youtube.com/watch?v=Aq_SOvR1Sxs&t=86s .

I suspect the waveform is already down-converted to be a complex baseband signal, yet the plot has the carrier frequency arbitrarily added.

Instead of doing the following:

fft_freqs = np.linspace(sample_rate / -2, sample_rate / 2, 1024) + center_freq

Consider the frequency axis for the filter as:

fft_freqs = np.linspace(sample_rate / -2, sample_rate / 2, 1024) 

This will result in the normalized frequency range properly extending from $-0.5$ to $+0.5$ cycles/sample.

The function iirnotch is a real filter and thus will notch the same frequency from $f=0$ to $f=+0.5$ as $f=0$ to $f=-0.5$ cycles/sample, with $f=0.5$ cycles per sample corresponding to $w0=1$ for use in the iirnotch function.

Please see DSP.SE #31028 for further details on implementing IIR notch filters. For an intuitive explanation on notch filters aimed toward those less familiar with signal processing, this YouTube interview may be of interest: https://www.youtube.com/watch?v=Aq_SOvR1Sxs&t=86s .

I suspect the waveform is already down-converted to be a complex baseband signal, yet the plot has the carrier frequency arbitrarily added.

Instead of doing the following:

fft_freqs = np.linspace(sample_rate / -2, sample_rate / 2, 1024) + center_freq

Consider the frequency axis for the filter as:

fft_freqs = np.linspace(sample_rate / -2, sample_rate / 2, 1024) 

This will result in the normalized frequency range properly extending from $-0.5$ to $+0.5$ cycles/sample.

The function iirnotch is a real filter and thus will notch the same frequency from $f=0$ to $f=+0.5$ as $f=0$ to $f=-0.5$ cycles/sample, with $f=0.5$ cycles per sample corresponding to $w0=1$ for use in the iirnotch function. What you may actually have with the complex baseband signals is the need to notch individual frequencies which may not be complex conjugate symmetric, in which case a filter with complex coefficients is used, which can notch individual tones above or below the center frequency of the signal.

Please see DSP.SE #31028 for further details on implementing IIR notch filters. For an intuitive explanation on notch filters aimed toward those less familiar with signal processing, this YouTube interview may be of interest: https://www.youtube.com/watch?v=Aq_SOvR1Sxs&t=86s .

added 84 characters in body
Source Link
Dan Boschen
  • 55k
  • 2
  • 59
  • 143

I suspect the waveform is already down-converted to be a complex baseband signal, yet the plot has the carrier frequency arbitrarily added.

Instead of doing the following:

fft_freqs = np.linspace(sample_rate / -2, sample_rate / 2, 1024) + center_freq

Consider the frequency axis for the filter as:

fft_freqs = np.linspace(sample_rate / -2, sample_rate / 2, 1024) 

This will result in the normalized frequency range properly extending from $-0.5$ to $+0.5$ cycles/sample.

The function iirnotch is a real filter and thus will notch the same frequency from $f=0$ to $f=+0.5$ as $f=0$ to $f=-0.5$ cycles/sample, with $f=0.5$ cycles per sample corresponding to $w0=1$ for use in the iirnotch function.

Please see DSP.SE #31028 for further details on implementing IIR notch filters. For an intuitive explanation on implementing IIR notch filters aimed toward those less familiar with signal processing, see this YouTube interview I did with Robert Feranecmay be of interest: https://www.youtube.com/watch?v=Aq_SOvR1Sxs&t=86s as well as DSP.SE #31028.

I suspect the waveform is already down-converted to be a complex baseband signal, yet the plot has the carrier frequency arbitrarily added.

Instead of doing the following:

fft_freqs = np.linspace(sample_rate / -2, sample_rate / 2, 1024) + center_freq

Consider the frequency axis for the filter as:

fft_freqs = np.linspace(sample_rate / -2, sample_rate / 2, 1024) 

This will result in the normalized frequency range properly extending from $-0.5$ to $+0.5$ cycles/sample.

The function iirnotch is a real filter and thus will notch the same frequency from $f=0$ to $f=+0.5$ as $f=0$ to $f=-0.5$ cycles/sample, with $f=0.5$ cycles per sample corresponding to $w0=1$ for use in the iirnotch function.

For an intuitive explanation on implementing IIR notch filters, see this YouTube interview I did with Robert Feranec: https://www.youtube.com/watch?v=Aq_SOvR1Sxs&t=86s as well as DSP.SE #31028.

I suspect the waveform is already down-converted to be a complex baseband signal, yet the plot has the carrier frequency arbitrarily added.

Instead of doing the following:

fft_freqs = np.linspace(sample_rate / -2, sample_rate / 2, 1024) + center_freq

Consider the frequency axis for the filter as:

fft_freqs = np.linspace(sample_rate / -2, sample_rate / 2, 1024) 

This will result in the normalized frequency range properly extending from $-0.5$ to $+0.5$ cycles/sample.

The function iirnotch is a real filter and thus will notch the same frequency from $f=0$ to $f=+0.5$ as $f=0$ to $f=-0.5$ cycles/sample, with $f=0.5$ cycles per sample corresponding to $w0=1$ for use in the iirnotch function.

Please see DSP.SE #31028 for further details on implementing IIR notch filters. For an intuitive explanation on notch filters aimed toward those less familiar with signal processing, this YouTube interview may be of interest: https://www.youtube.com/watch?v=Aq_SOvR1Sxs&t=86s .

Source Link
Dan Boschen
  • 55k
  • 2
  • 59
  • 143

I suspect the waveform is already down-converted to be a complex baseband signal, yet the plot has the carrier frequency arbitrarily added.

Instead of doing the following:

fft_freqs = np.linspace(sample_rate / -2, sample_rate / 2, 1024) + center_freq

Consider the frequency axis for the filter as:

fft_freqs = np.linspace(sample_rate / -2, sample_rate / 2, 1024) 

This will result in the normalized frequency range properly extending from $-0.5$ to $+0.5$ cycles/sample.

The function iirnotch is a real filter and thus will notch the same frequency from $f=0$ to $f=+0.5$ as $f=0$ to $f=-0.5$ cycles/sample, with $f=0.5$ cycles per sample corresponding to $w0=1$ for use in the iirnotch function.

For an intuitive explanation on implementing IIR notch filters, see this YouTube interview I did with Robert Feranec: https://www.youtube.com/watch?v=Aq_SOvR1Sxs&t=86s as well as DSP.SE #31028.