How to detect the fundamental frequency in a signal using wavelets? -
i have noisy sine signal want extract fundamental frequency of sine. should use?
the signal in discrete time domain known sampling frequency. trying corroborate answer got fft analysis cannot use fft.
here piece of r
code implements continuous wavelet transform on signal (using biwavelet
package).
the signal composed of sine wave frequency 40 hz , random noise. result spectrum showing frequency 40 hz dominates in 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 results par(mfrow=c(2,1)) plot.default(signal, type = "l", xaxs = "i") # signal plot.biwavelet(w, useraster = true) # spectrum of signal
Comments
Post a Comment