ADSP Assignment 1
ADSP Assignment 1
Assignment # 1
Code:
[y,fs]= audioread('Rec.wav');
a. Find out the sampling frequency and the length of the signal.
Code:
>> fs
fs = 44100
>> length(y)
ans = 302080
b. Down sample by the factor of 2 and 5.
Code:
x=downsample(y,2);
z=downsample(x,5);
c. Find out the length of the new signal.
Code:
>> length(z)
ans = 30208
d. Compute 1, 2 and infinite norms.
Code:
>> a=norm(z,1)
a = 1.7733e+03
>> b=norm(z)
b = 17.9174
>> norinf=norm(z,inf)
norinf = 0.6447
e. Plot original sampled signal and draw a line on the graph representing sampling
frequency.
Code:
n=[0:length(z)-1];
df=fs/length(y);
f=df*n;
plot(f,z)
grid on
-3 n 3
-1 n 5
Code:
y=[6, -3, -1, 0, 8, 7, 2]
n=-1:1:5;
stem(n,x)
2n8
stem(c,x)
b. d[n] = y[-n-3]
Code:
y=[6, -3, -1, 0, 8, 7, 2]
n=-1:1:5;
c=-n-3;
stem(c,x)
c. e[n] = w[-n]
Code:
w=[3 2 2 -1 0 -2 5]
n=2:1:8;
c = -n;
stem(c,x)
d. u[n] = x[n].w[n+4]
Code:
normzinf = 0.6447