function wave = dualBitGen(bit,num,sps)
% bit: 1 means bit "1", 0 means bit "0".
% num: how many certain bit to generate.
% audioFileName: like 'audio.wav'.
if (bit==0) bit = 2; endif % data of bit "0" stores in second column in a matrix
bps = 16; % bits per sample
%sps = 960000; % sample rate [samples/s]
period = [0.0016 0.0008]; %period of bit "1" and bit "0", respectively [s]
freq = floor(1./period); % frequency of the tone [Hz]
nsecs = num*period(bit); % number of seconds of the audio file
nsamples = sps*nsecs;
time = linspace(0, nsecs, nsamples);
wave = [ones(floor(size(time,2)/2),1);zeros(floor(size(time,2)/2),1)];