Technology Programming

How to Find the Frequency of Noise in MATLAB

Instructions

1

Import data containing your signal into a one-dimensional vector of length "n:"

my_signal = zeros(1,n);
my_signal = ...
2

Remove high-frequency noise from your signal using the "smooth()" function:

my_smoothed_signal = smooth(my_signal);

Often noise is separated from your desired signal in frequency. It is common to have high-frequency noise, especially in the range of 60 Hz due to electrical interference. The default of smooth() using a rolling average filter with a width equal to five adjacent data points. The value of the width may need to be adjusted depending on the specifics of your signal.
3

Subtract the smoothed signal from your original signal to isolate the high-frequency noise:

my_noise = my_signal - my_smoothed_signal;
4

Estimate the power spectral density of the noise using the "periodogram()" function:

[spectral_density, frequencies] = periodogram(my_noise);

Leave a reply