Roy2511
Roy2511

Reputation: 1048

How to detect the fundamental frequency in a signal using wavelets?

I have a noisy sine signal from which I want to extract the fundamental frequency of the sine. What should I use?

The signal is in the discrete time domain with a known sampling frequency. Actually I am trying to corroborate the answer I got by an FFT analysis so I cannot use a FFT.

Upvotes: 0

Views: 1156

Answers (1)

Viliam Simko
Viliam Simko

Reputation: 1841

Here is a piece of R code which implements continuous wavelet transform on some signal (using the biwavelet package).

The signal is composed of a sine wave with frequency 40 Hz and random noise. The result is a spectrum showing that the frequency 40 Hz dominates in the whole signal.

signal.len <- 1024  # input param.
sin.freq   <- 40    # input param.

# noise + 40 Hz sine wave
signal <- rnorm(signal.len) + sin(sin.freq*2*pi/signal.len * 1:signal.len)

library(biwavelet) 
w <- wt(cbind(index(signal), signal))  # continuous wavelet transform

# rendering the results
par(mfrow=c(2,1))
plot.default(signal, type = "l", xaxs = "i")  # the signal
plot.biwavelet(w, useRaster = TRUE)           # spectrum of the signal

enter image description here

Upvotes: 0

Related Questions