Develop a subVI called gposc.vi that accepts a frequency trajectory (in Hz), an amplitude trajectory, and a sampling frequency (in Hz) to produce a sinusoidal output whose amplitude and frequency tracks the two input trajectories, respectively. The two trajectories are arrays that should be of the same length.
Demonstrate that your oscillator works properly by showing the output of your VI (spectrogram and .wav file) for the amplitude and frequency trajectories produced by a LabVIEW MathScript node that contains the following code:
ff=[linspace(200,1600,2.5*fs) ...
linspace(1600,800,1.5*fs)];
aa=[linspace(1,0,3*fs) ...
linspace(0,0.75,fs)];
where fs is the sampling frequency in Hz, ff is the output frequency trajectory (also in Hz), and aa is the amplitude trajectory (between 0 and 1). Use a sampling frequency of 5 kHz when you make the spectrogram and soundfile.
Plot the trajectories ff and aa and compare to your spectrogram.
Remember, the instantaneous frequency of your general-purpose sinusoidal oscillator is related to the time-varying phase of the sine function. That is, if the sinusoidal signal is defined as
y(t)=sin(θ(t))
y(t)=sin(θ(t))
,
then the instantaneous frequency of the sinusoid is
ω(t)=
dθ(t)
/
dt
ω(t)=
dθ(t)
/
dt
radians per second. Because you are given a frequency trajectory that relates to
ω(t)
ω(t)
, which mathematical operation yields the phase function
θ(t)
θ(t)
?
Here's a LabVIEW coding tip: You will find the built-in VI "Mathematics | Integ and Diff | Integral x(t)" to be essential for this part of the project.
"A multimedia educational resource for signal processing students and faculty."