# Extract a signal from noise, so I can view noise spectrum only?

I have a perfect modulated signal. I have the same signal but with noise, this noise is from non linear amplification.

Is it possible, to extract the clean signal so it's just leaving the noise? The spectrum of the noise is important for me to characterise. What would be the method? Cross correlation?

• Do you know the nonlinear transfer function ?
– user67664
Commented Jul 5, 2023 at 17:20

Is it possible, to extract the clean signal so it's just leaving the noise?

Strictly speaking, no: With sufficiently bad luck, your noise might just look like signal, and you loose information irrecoverably.

Practically speaking, maybe: However, if your SNR is good, you might be able to estimate the transmitted signal out of the received signal (which is exactly what a receiver does, it estimates the data that was sent!). Then, you can "re-synthesize" the clean signal as you received it, subtract it from what you actually received, and get the pure noise.

The spectrum of the noise is important for me to characterise. What would be the method? Cross correlation?

Well, the spectrum of the noise, assuming the noise is uncorrelated to the signal, will just be the difference between the received spectrum and the signal spectrum. If you know the signal's spectrum, you can estimate the noise spectrum simply by finding the difference between the two PSDs.

So, estimating the noise spectrum is easier than estimating the actual noise.

When you say you "have" the perfect modulated signal does that mean you know exactly what the waveform is? If so, then it should be possible.

I'm going to ignore things like Doppler shifts and assume that you have a real received signal that's the original signal with a shift in time and amplitude and added noise. I'd run an optimization algorithm to find the ideal time shift and amplitude shift that minimizes your cost function. The ideal cost function would probably be minimizing the L2-norm of the resulting signal when you subtract the received, noisy signal that's shifted and scaled from your pristine signal. This would also get you the data you want under the hood, just that subtraction before you take the L2-norm. SciPy has some good optimization routines in scipy.optimize. So it would be something like this:

$$\mathrm{argmin}_{A, \Delta_t} \sum_t |p(t) - A \, r(t - \Delta_t)|^2$$

Where $$p(t)$$ is the pristine, ideal signal and $$r(t)$$ is the received, noisy signal.

For digital signals note that subtraction of $$\Delta_f$$ isn't trivial, you'll probably need a step that will do sinc-interpolation and resampling of the received signal in case the time shift is a sub-sample shift. Unless you're incredibly oversampled this will be quite necessary. Here's an answered question on how to do the resampling that doesn't change the rate but just gets you sub-sample shifts.

Note that often this is a real-time problem and there are more advanced adaptive techniques. But I'm assuming you have the entire data set and can do batch processing, which helps out.