Description Usage Arguments Details Value Examples
The envelope of an amplitude modulated signal can be calculated by using the Hilbert transform H(y) of the signal or the analytic signal.
1 | envelope(y)
|
y |
numeric vector of the signal |
An amplitude modulated function y(x) = A(x) * cos(ω * x) can be demodulated as follows:
A(x)^2 = y(x)^2 + H(y(x))^2
If the signal is not band limited, strange things can happen. See the ripple at the edges in the example below. Pay attention, that the envelope is always the real part of the returned value.
real valued envelope function of the signal
1 2 3 4 5 6 7 8 9 10 11 12 | ## noisy signal with amplitude modulation
x <- seq(0,1, length.out=2e2)
# original data
y <- (abs(x-0.5))*sin(20*2*pi*x)
ye <- base::Re(envelope(y))
# plot results
plot(x,y,type="l",lwd=1,col="darkgrey",lty=2,ylab="y",main="Spectral filtering")
lines(x,ye)
legend("bottomright",c("modulated","envelope"),col=c("grey","black"),lty=c(2,1))
|
Loading required package: rasterImage
Loading required package: plotrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.