You are on page 1of 22

Signals and Systems 

(Academic Year 2019-2020) 


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Name: ​Parija Malgaonkar 
Roll Number​ : BT18ECE040 
 
 
 
 
 

INDEX 
 
Serial  Name of the  Date of  Date of 
Number  experiment  experiment  submission 

1  Introduction to  28/07/19   


octave 

2  Karaoke using  1/08/19   


octave 

3  Plotting  8/08/19   
Sinusoidal 
waves 

4  Aliasing Effect  8/08/19   


5  Convolusion     
6  Fourier series     
(continuous 
signal) 
 
 
 
 
 
 
 
 
 
 
 
 
 

Experiment 1 
 
AIM​: I​ntroduction to application of octave for plotting signals. 
Transforming voice signal i.e scaling, shifting, inverting, amplifying 
using Octave. 
 
 
SOFTWARE USED:​Octave  
 
INTRODUCTION:  
 
A signal is a description of how one parameter varies with another 
parameter. For instance, voltage changing over time in an 
electronic circuit, or brightness varying with distance in an image.  
 
A system is any process that produces an output signal in 
response to an input signal. 
 
DESCRIPTION​: 
 
● We learnt how to create an array of nos from 1 to 10. 
● Multiplication = x*(complement of y). 
● Plotting graphs using plot() command.  
● Giving comments to any statement.   
● Then we learnt to use CLC, CLOSE ALL, CLEAR command 
before starting the program of octave.  
 
● Operations on our voice signal: 
1. Listen to our own voice in octave 
2. Flipping our voice 
3. Amplifying our voice 
4.Shifting our voice  
1. Listen to our own voice using octave 
 
Firstly we uploaded the file in the wav format i.e using the 
extension “.wav”. 
Then using the audioread and sound command, we listened to 
the voice signal.  
 
Command: 

[y,fs]=audioread(“path of the wave”); 


sound(y,fs); 
 

 
 
2. Flipping of voice 

Flip command is used to flip the voice signal. 

Command: 
 
[y,fs]=audioread('C:\Users\AYUSHI\Downloads\yes4.wav'); 
c1=y(:,1); 
c2=flip(c1); 
flip(c2); 
plot(c2); 
 
 
 
 
 
3.Voice amplification: 

We amplified the voice signal by multiplying it with a scalar 


quantity. 
 
Commands: 
 
[y,fs]=audioread('D:\Parija\maybe-next-time.wav'); 
c1=y(:,1); 
plot(c1); 
c2=10*c1; 
hold on; 
plot(c2); 
 

 
 
 
4. Shifting of the signal 
 
The signal was shifted by addition or subtraction using the ‘+’ or 
the ‘-’ operator. 
 
Commands: 
[y,fs]=audioread('D:\Parija\maybe-next-time.wav'); 
c1=y(:,1); 
plot(c1); 
c2=2+c1; 
hold on; 
plot(c2);  
 
 
 
RESULT​ : ​
Through this experiment,we learned the shifting, 
flipping,amplification of the sound. 

 
Experiment 2 

AIM​ ​ erging the karaoke and the vocal by octave. 


:​ M

SOFTWARE USED​
: ​
Octave-GUI 

PROCEDURE:

● For this task, firstly we had downloaded the karaoke of the 


song “Blank Space” and converted into a wav file. 
 
● Then, I merged the vocals with the karaoke using merge 
command on octave. 

 
RESULT: W
​ ith the help of octave, the two audio files in the wav 
format were merged successfully. 

Experiment 3 
 
AIM​ ​lotting sinusoidal waves and using subplot to plot them on 
:​ P
a single page 
 
SOFTWARE USED​ : ​
Octave-GUI 

THEORY & DESCRIPTION:


 
● We plotted various sine and cos waves and used the subplot 
command to plot these various graphs in a single page. We 
also used the stem command to plot with samples. 
 
 
COMMANDS: 
Plotting various sine and cos waves: 
 
fs=100; 
n=0:99; 
k=1; 
for F=10:10:100 
x=cos(2*pi*F/fs*n); 
subplot(5,2,k); 
stem(x); 
k++; 
endfor 
 
 
 
 
 
Graph: 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Experiment 4 
 
AIM​ ​ bserving the phenomenon of aliasing effect of the signals. 
:​ O
 
 
SOFTWARE USED​
: ​
Octave-GUI 

THEORY & DESCRIPTION:


 
● It is an effect that occurs when a signal is sampled at too low 
a frequency. The higher frequency components of the signal 
cannot be captured because of the low sampling frequency, 
which results in overlap in the spectrum.  
 
 
COMMANDS: 
 
n=0:100; 
Fs=100; 
F=20; 
x=cos(2*pi*F/Fs*n); 
plot(n,x); 
hold on; 
f=80; 
x=cos(2*pi*F/Fs*n); 
plot(n,x,’rs’); 
xlabel(‘n’) 
ylabel(‘x’) 
 
 
 
GRAPH: 
 
 
 
 
 
 
 
 
 
 
 
 
 
Experiment 5 
 
AIM​ ​o
:​ T perform convolution of signals.

 
 
SOFTWARE USED​
: ​
Octave-GUI 

THEORY & DESCRIPTION:


 

Convolution is a mathematical operation used to express the 


relation between input and output of an LTI system. It relates input, 
output and impulse response of an LTI system as: 

  

y(t)=x(t)*h(t) 
Where y (t) = output of LTI 
x (t) = input of LTI 
h (t) = impulse response of LTI  

  
 
 
 
 
 
 
There are two types of convolutions: 
● 1. Continuous convolution 
● 2. Discrete convolution 

  

Continuous Convolution: 

Where, f = input signal 

g = impulse response of an LTI system 

  

D
​ iscrete Convolution:  

Where, f = input signal 

  g = impulse response of an LTI system 

TASK 1​: To write code for convolution of two signals 

and record the output. 

 
CODE: 
clc; 
clear all; 
close; 
sum=0; 
y=[0,0,0,0,0,0,0,0]; 
x=[1,2,3,4,0,0,0,0]; 
h=[1,2,3,4,0,0,0,0]; 
for n=1:8 
for k=1:n 
if (n-k)>0 
y(n)=y(n)+x(k)*h(n-k); 
endif 
endfor 
endfor 
y(1)=[]; 
stem(y); 
 
Graph: 

 
 
 
 

 
TASK 2​: - To record impulse response in an empty room and record the 
output signal for any input signal by convolution.

CODE:

clc;clear;close all; 

[y, fs1] =audioread ('voice3.wav'); 

c1 = y(1:60000,1); 

[x, fs2] =audioread ('voice2.wav'); 

c2 = x(:,1); 

z=conv(y,0.01*x(:,1)); 

sound(y,fs1); 

sound(x,fs2); 

sound(z,fs1); 

plot(z); 

OBSERVATION AND RESULT​: With the help of this experiment, we get to analyze
how our voice appears to sound if we had recorded that in the lab itself.

 
 
 
 
 
 
Experiment 6 
 
​ourier series transformation, Finding the values of Fourier 
AIM​:​ F
components for a given range of k of a given signal. 
 
Plot graphs for​:  
1. Fourier component’s magnitude v/s abs(a) 
2. Fourier component’s magnitude v/s angle(a)  
3. Original signal v/s time(t) 
 
SOFTWARE USED​:​ ​ Octave-GUI 
 
 
THEORY:​ T ​he discrete-time Fourier transform of a discrete set of 
real or complex numbers x[n], for all integers n, is a Fourier series, 
which produces a periodic function of a frequency variable. When 
the frequency variable, ω, has normalized units of sample, the 
periodicity is 2π, and the Fourier series is shown in this given 
experiment. 
 
 
 
 
 
 
 
 
 
 
 
 
Command Window: 
 

 
 
 
 
 
 
 
 
 
 
Graphs: 
 

 
 
 
 
OBSERVATIONS AND RESULT: ​Here we plot the different graphs 
for analyzing Fourier series transformation for discrete-time 
signals There is plotting the square wave using the inbuilt 
function, so I did the experiment using the linspace command. 
 
 
 
 
 
 
 
 
 
Experiment 7 
 
​econstruct the original signal by summing up the different 
AIM​:​ R
values of Fourier coefficients. 
 
SOFTWARE USED​:​ ​ Octave-GUI 
 
Command Window and Graph: 
 

 
 
 
RESULT:​ Reconstruction of the original signal is done by using 
different values of k. 
 
 
 
 
 
 
 
 

You might also like