Combined sine, adjust phase and frequency Make a plot_ly plot, combining two sine waves with nearby frequencies through multiplcation. Give controls over the phase of the second sine wave. See what it does to the result.
Trig identity:
cos(α + β) = cos(α) cos(β) – sin(α) sin(β)
Rearranged:
sin(α) sin(β) = cos(α) cos(β) + cos(α + β)
So if one wave has frequency of 1 Hz, and other 2 Hz, what does phase do to signal?
Actually Plot_ly plots have all data evaluated ahead of time, with the controls only determining what data gets called upon.
For a good example, look here: https://plotly.com/r/sliders/
## Loading required package: ggplot2
## ## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2': ## ## last_plot
## The following object is masked from 'package:stats': ## ## filter
## The following object is masked from 'package:graphics': ## ## layout