MATLAB: Sinusoid with amplitude , frequency, samples, and sampling frequency ww how can i generate a sinusoid with amplitude 0.1 , frequency 100 Hz, with 100,000 samples, and sampling frequency 22,050 HZ? Please can anyone help me? thank you Best Answer Did you try this?amplitude = 0.1;frequency = 100 % HznumSamples = 100000 % samplessamplingFrequency = 22050 % Hz (per second)numSeconds = numSamples / samplingFrequencyx = linspace(0, numSeconds, numSamples);y = amplitude * sin(2 * pi * x * frequency);plot(x, y, 'b-', 'LineWidth', 2);grid on;xlabel('X', 'FontSize', 15);ylabel('Y', 'FontSize', 15); Related SolutionsMATLAB: Sampling doc linspacedoc randn MATLAB: Finding frequency and duration of an audio signal You specified it to be 1 kHz, and 1 second duration, so it is just that: fs=24000.0; % Sampling rate t=0:1/fs:1; % One sample each Ts=1/fs x=cos(2*pi*1000*t);sound(x,fs);L = numel(t);fn = fs/2;FTx = fft(x)/L;Fv = linspace(0, 1, fix(L/2)+1)*fn;Iv = 1:numel(Fv);figureplot(Fv, abs(FTx(Iv))*2)gridxlim([0 2000])The Fourier transform plot demonstrates it. Related QuestionSamplingReading, writing and processing .wav files in MatlabHow to plot (1) amplitude vs time and (2) amplitude vs frequency plots from .wav filePower Spectral Density two approachesSampling data
Best Answer