Reputation: 1048
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
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
Upvotes: 0