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() ```