MATLAB/Sound/Emergence of beats

From Wikiversity
Jump to navigation Jump to search
clc; clear all; close all;
% Most sound cards support sample rates between approximately 5,000 and 48,000 
% hertz. Specifying sample rates outside this range can produce unexpected results.
dt=1/8192; %is Matlab's default sampling rate (period)
dur=15; %sets how long each note should be played
t = [0:dt:dur]; %sets the timeframe for a single note
f0=200;omega0=2*pi*f0; %Sets the fundamental frequency 

y2 =sin(omega0*(1+a.*t).*t);