I am reading out the movement of a motor arm using a Hall sensor and a magnet pair. The hall sensor measures the distance between the sensor and the magnet. The motor arm is being moved with a band-limited Gaussian white-noise signal (0-300 Hz). Due to the movement being very small, the stimulus being a white-noise, and the inherent noise of the Hall sensor, I have a terrible Signal to Noise Ratio. I am trying to improve the SNR by filtering. But the problem is that, the frequencies in the sensor output in the absence of any movement of the motor (baseline noise, in blue) hugely overlap with the frequencies of the actual movement (0-600 Hz) and noise (stimulus, in orange).

The figure below shows the generated white-noise signal that I use to actuate the motor (in black). Grey background marks the presence of a movement stimulus to the motor arm (this signal is in orange in rest of the figures). Notice the 0 baseline outside the grey region in subplot 1. The subplot below it shows the unfiltered hall sensor output. Notice the high baseline noise in the absence of any actual movement. So, this "baseline noise" is the inherent noise of the Hall sensor.

Generated signal and hall sensor output

Without filtering, the baseline and stimulus are indistinguishable. Raw data from Hall sensor

But, the powers are slightly different for frequencies below 150 Hz. But the noise and the signal have the same power after 150 Hz. I do need better SNR in this range.

PSD of unfiltered baseline noise and stimulus with noise

I tried filtering the signal with 10th order Butterworth with cut-off at 600 Hz (Because I need 300 Hz to be represented properly). I can now distinguish baseline from stimulus but SNR is still very bad, as visible in the PSD.

Filtered Hall sensor output PSD of filtered baseline noise and stimulus with noise

I want to use the noise in the baseline to denoise the stimulus. How should I do it?

  • $\begingroup$ can you stimulate the sensor using a single frequency? For example, start at 1 Hz, perform a synchronous demodulation, extract the amplitude and phase. Then repeat at 2 Hz, and on and on until you have an adequate frequency response. $\endgroup$
    – Ben
    Feb 19 at 15:45
  • $\begingroup$ Actually, I am using this as a stimulus delivery system to study a biological sensor in an insect. The hall sensor is my readout of the actual movement delivered. Using band-limited white noise is an established technique to study the properties of biological sensors. Because, one is constrained by time to record the response to discrete sinusoidal stimuli. I want to analyze the response of the biological sensor to the white-noise stimuli. $\endgroup$ Feb 19 at 17:25
  • 1
    $\begingroup$ Just to clarify, you have a section where you have noise only, and a section where you have noise and unknown signal? And then do you only need a denoised signal, or do you need a clean PSD as well? $\endgroup$
    – Baddioes
    Feb 19 at 18:36
  • 1
    $\begingroup$ @Ben Good suggestion. I have done a frequency sweep and analyzed the data to some extent. The output is much cleaner there and the analysis is much simpler. I will look up synchronous demodulation (thanks for the bonus tip). But my goal is to compare the white-noise analysis with other ways of characterizing a biological sensor. So, I need to analyze the white-noise noisy data as well. $\endgroup$ Feb 20 at 3:10
  • 1
    $\begingroup$ "Actually, I am using this as a stimulus delivery system to study a biological sensor in an insect." So your ultimate goal is to get a mathematical model of the actuator itself, independent of the sensor, and denoising the sensor data is just a means to an end? If this is the case, edit the first paragraph of your question or add a new one to make it clear what you really want to do. $\endgroup$
    – TimWescott
    Feb 23 at 15:58

2 Answers 2


This would be a good application for using the Cross Spectral Density between the input and output. The Cross Spectral density (which is Coherence when normalized) provides the relative magnitude and phase for the system transfer function based on the correlated components between the input noise-like signal and the resulting output noise-like signal while attenuating the independent noise components present regardless of input. Please see these other posts for further explanation of this as well as further details in computing the CSD:


Intuitive explanation of coherence

The result will have best fidelity where the input signal has energy in the frequency domain, so for this purpose a white noise input is ideal. The stronger the input can be while still in the linear range of the system, the better the resulting estimate will be (in terms of SNR).


You can technically use a white noise stimulus to perform a system identification, I would not do it for the following reasons

  1. The white noise stimulus seems to have a lower amplitude than the baseline white noise, making it hard to distinguish what your actual stimulus is. Maybe you can increase the amplitude of your stimulus ?
  2. Even if you can increase the amplitude of the stimulus, you basically input a wideband signal and try to deduce the frequency response and transfer function. It's gonna be hard to identify the amplitude and phase at higher frequencies, especially if you have a 20 dB or 40 dB/decade rolloff. Even if you had an infinite-precision ADC, the high frequency signals will be buried in white noise.

I recommand performing a sine sweep for system identification. Basically, you input a sine with an amplitude that will not saturate your sensor or your ADC.

$ x = Asin(\omega t) $

Wait for the transient to die out, then measure the amplitude of the output signal, it should look like this $y = Bsin(\omega t + \phi)$

Perform a synchronous demodulation, to extract the gain and phase at that specific frequency. You can average multiple cycles to increase the SNR. This can be useful if you want to measure low amplitudes. If you see a resonance, I recommand that you take more data points around the resonance frequency as resonances can greatly impact the design a control loop.

  • $\begingroup$ Are you suggesting that I do this to characterize the Hall sensor and use the frequency response to denoise the signal? Or are you suggesting that I use frequency sweeps instead of white noise in my experiment? $\endgroup$ Feb 20 at 14:01
  • $\begingroup$ He’s suggesting the latter. $\endgroup$
    – Jdip
    Feb 20 at 14:52
  • $\begingroup$ Yes, I would not use a white-noise approach to characterize a sensor or a system. I recommend a frequency sweep. You could also perform a step response if you want, but it's not gonna be as accurate as a frequency sweep. $\endgroup$
    – Ben
    Feb 20 at 15:15
  • $\begingroup$ My experiments are done. Cannot redo it. Also, I want to analyze the response of my biological sensor(a neuron) to white noise. The response (output of the neuron) looks very reliable even though the measurement of the stimulus is noisy. The stimulus itself is probably not so bad. Please suggest any suggestions you have to denoise this data. $\endgroup$ Feb 20 at 17:23
  • 1
    $\begingroup$ I'm not sure you can extract something from what seems to be nothing. $\endgroup$
    – Ben
    Feb 20 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.