0
$\begingroup$

I have data coming off an software defined radio, I want to remove a certain signal(interference) from a spectrum new to DSP. I am using python. the signal comes in as an array of complex numbers (real-imag). I get the frequencies and powers from the welch method. If I want to remove a spike given a selected frequency range back down to the noise floor. I know if you know the origional signal in the spectrum its a matter of subtracting the offending vector from whole spectrums vector (arrays of complex numbers). My thoughts are I may need to work backwords and convert the part of the psd I want to remove back to IQ(inphase-quadtrature), then subtract that from the spectrum? Is this even possible to do? Or I can save off the incoming signal and subtract the portion out if its possible to relate the power/freqencies back to the part of the IQ array. idk! Help!

center_frequency = 0 symbol_rate = 1 sampling_rate = 80 # per second # amplitude = 2 # range of vertical movement alpha = 0.25 noise_amplitude = 1 #fft sp = np.fft.fft(np.sin(signal)) freq = np.fft.fftfreq(output.shape[-1]) #phase phase = np.arctan2(signal.real, signal.imag) #or phase #phase = np.angle(signalFFT) # PSD f, Pxx = scipy.signal.welch(signal, fs = sampling_rate) #Producing the PSD for the signal Pxx = np.log(Pxx) # PLOT PSD fig, axes = plt.subplots(sharey=True, ncols=2) fig.suptitle('Successful Excision', fontsize=30) fig.set_figheight(6) fig.set_figwidth(18) axes[0].plot(f, Pxx) axes[0].title.set_text('Origional signal') # axes[1].plot(fe, pxxe) # axes[1].title.set_text('Excised signal') plt.show() #plot phase fig1 = plt.plot() plt.plot(phase) plt.title("phase") plt.show() #plot ffts plt.plot(freq, sp.real, freq, sp.imag) plt.title("ffts") plt.show() ``` 
$\endgroup$
5
  • $\begingroup$ I'm not sure if this is what you are looking for, but one definition of the PSD relates the amplitude spectrum to the PSD via a magnitude squared operation. However, why not just take an FFT, remove that spike, and IFFT? This would preserve phase information of the other components. $\endgroup$ Commented Jun 25, 2024 at 22:07
  • $\begingroup$ Can you please edit your question for clarity! Most importantly, do you have the original signal, or don't you? Next most important, do you know ahead of time what band of frequencies you want signal removed from? In general, if you have a PSD but not the original signal, information has been lost and you can't restore the original. $\endgroup$ Commented Jun 26, 2024 at 14:17
  • $\begingroup$ I do have the original. I need to subtract and offending signal interfering with the rest. to identify the offending signal I look at the PSD $\endgroup$ Commented Jun 26, 2024 at 16:28
  • $\begingroup$ the signal variable is the original signal data coming off an SDR $\endgroup$ Commented Jun 26, 2024 at 16:37
  • $\begingroup$ A potential idea. Take the square root of the PSD after removing the unwanted signal and apply the phase of the amplitude spectrum to the square root of the PSD. $\endgroup$ Commented Jun 27, 2024 at 2:46

1 Answer 1

0
$\begingroup$

A simple approach would be to take the FFT, excise the offending bins and convert back to the time domain, but this results in more distortion (and more delay and more processing) than other direct filtering techniques. One such technique is a simple 2nd order notch filter as detailed in this post and demonstrated in this YouTube video with Robert Feranec:

https://youtu.be/Aq_SOvR1Sxs?si=YwstRBckZykVgPsv

Also the Welch method is not ideal for evaluating the strength of narrow band tones; to observe those I recommend a direct FFT spectrum plot as I demonstrate in this post.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.