logo

Synthesis of Sinusoidal Signals-MUS Signal Processing Lab 04

12 Pages2092 Words491 Views
   

Added on  2023-05-28

About This Document

The lab experiment focuses on the music synthesis and sinusoids. The lab seeks to establish a connection between the musical notes and their respective frequencies and sinusoids. The implementation of structure for grouping information in MATLAB scripts results in the output below for the script code snippet attached.

Synthesis of Sinusoidal Signals-MUS Signal Processing Lab 04

   Added on 2023-05-28

ShareRelated Documents
STUDENT NAME
STUDENT ID NUMBER
Institutional Affiliation
Location
Instructor (tutor)
Date of submission
12/5/2018
Synthesis of Sinusoidal Signals-MUS Signal Processing Lab 04_1
INTRODUCTION
The lab experiment focuses on the music synthesis and sinusoids. There is need to employ great
effort in determining the documented work and MATLAB implementation.
LAB EXPERIMENT: PRE-LAB
PART I: D-TO-A CONVERSION
The songs are extracted from the long list of Beethoven music from the 19th century. One of the
songs considered for this experiment is the “hallelujah”. The music synthesis will be done with
sinusoidal waveforms of the form,
x (t )=
k
Ak cos ( ωk t +φk )
The lab seeks to establish a connection between the musical notes and their respective
frequencies and sinusoids. This lab seeks to create the periodic waveforms for the music signals
and, thereafter, plays the music via a loudspeaker. There is need to convert the signals from
digital samples to an actual continuous waveform representing actual voltage and the values are
sent to the loudspeaker for analysis. The process requires that the signal is sampled and then
reconstructed from the digital samples stored in a computer memory. The block diagram below
shows the sampling and reconstruction process,
The input signal is sample by converting the continuous-time input signal to a discrete signal.
The discrete signal is sampled and quantized using the equation below based on the sampling
period,
x [ n ] =x ( nTs )
The process follows the sampling theorem where the input signal is given as a sum of sine waves
and the output is obtained as part of the input based on the sampling rate which is twice the
Synthesis of Sinusoidal Signals-MUS Signal Processing Lab 04_2
maximum frequency. The theorem is also known as the nyquist theorem. In the block diagram
there are two critical processes namely:
(i) Analog-to-digital converter
(ii) Digital-to-analog converter
Section a: The ideal C to D converter is demonstrated as shown in the procedure below using a
sampling frequency.
0 1 2 3 4 5 6 7 8
Time (sec) 104
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
Music Output
C to D Converter
To illustrate the sampled data,
Synthesis of Sinusoidal Signals-MUS Signal Processing Lab 04_3
%Section I
load handel
sound(y,Fs);
disp("The sampling frequency is, Fs:")
disp(Fs)
disp('The vector values for the music notes: ')
disp(y)
% To create a continuous time signal from the music notes
t=0:1:length(y)-1;
figure(1)
plot(t,y,'b-.')
grid on
xlabel('Time (sec)')
ylabel('Music Output')
title('Sound Signal-Halleluyah Song')
figure(2)
stem(y,'r')
grid on
xlabel('Time (sec)')
ylabel('Sampled Music Output')
title('Sound Signal-Sampled Discrete Signal'
Synthesis of Sinusoidal Signals-MUS Signal Processing Lab 04_4

End of preview

Want to access all the pages? Upload your documents or become a member.