function [yNoisy,ps] = singleFrequencySpectrogram(t,fs)
% Generate noisy data and the power spectrum for a sine wave at a random
% frequency.

% Set the center frequency of the sinusoid, and how much that frequency can
% randomly vary.
baselineFrequency = 25;
frequencyVariation = 10;

% Generate frequency.
freq = baselineFrequency + frequencyVariation*randn;

% Generate time series with background and noise.
yClean = sin(2*pi*freq*t);
yClean = addBackground(yClean,t);
yNoisy = addNoise(yClean);

ps = computePowerSpectrum(yNoisy,fs);
end