DCT For Speech Compression
DCT For Speech Compression
A
Mini project Presentation
On
2 B17EC015 06/27/2020
INTRODUCTION
• Data compression is a technique in which data content of
input signal to system is compressed so that original signal is
obtained as output and unwanted or undesired signals are
removed. Therefore speech signals are used in form of data
it is termed as SPEECH COMPRESSION.
• Speech is very basic way for humans to convey information
to one another. Speech compression involves coding of real
time audio signal at lowest possible bit rates.
• Compression reduces usage of resources like storage space
and transmission capacity.
3 B17EC015 06/27/2020
OBJECTIVE
speech compression is a process of lessening the dynamic
range between the dynamic and quietest parts of an audio
signal. This is done by boosting the quieter signal and
attenuating the louder signals. Speech compression enables
efficient storage and transmission of data.
When DCT is applied to speech signal we get desired
compressed signal both signals are represented as
waveforms as follows.
4 B17EC015 06/27/2020
DCT
For 1-D sequence, the DCT is given by
5 B17EC015 06/27/2020
GENERAL BLOCK DIAGRAM
Speech
signal reconstruct
signal
Transform
technique
Inverse
Thresholdin transform
g
coefficients
De-
quantizatio quantization
n
Compresse decodin
encoding
d data g
6 B17EC015 06/27/2020
SOFTWARE USED
MATLAB R2020a
Math Works
7 B17EC015 06/27/2020
ALGORITHM
Step2: divide the wave file and reshape into matrix form.
8 B17EC015 06/27/2020
ALGORITHM
9 B17EC015 06/27/2020
CODE
%reading the wave file
[y,Fs]=audioread('noicy.wav');
soundsc(y,Fs); %to hear sound from speaker
p = y;
a=size(p); %finding size of input
subplot(4,1,1);
plot(p); %plotting the input wave
title(‘input waveform’);
%applying DCT for the input signal to obtain DCT
coefficients
z= dct(p);
10 B17EC015 06/27/2020
CODE
subplot(4,1,2);
plot(z); %plotting DCT obtained DCT coefficients
title(‘input waveform after dct’);
%arranging DCT coefficients in descending order
[pp,psr] = sort(abs(z),'descend');
subplot(4,1,3);
plot(psr); %plotting the sorted
title(‘waveform plotting after sorting in descending
order’);
11 B17EC015 06/27/2020
CODE
%finding the coefficients representing 99 percent of
energy
flag = 1;
while norm(z(psr(1:flag)))/norm(z)<0.999
flag = flag+1;
end
xp= flag/length(z)*100;
%initializing coefficients which representing 0.01 percent
of energy to zero
z(psr(flag+1:end)) = 0;
12 B17EC015 06/27/2020
CODE
%converting DCT matrix into .wav files by using IDCT
operation
xx = idct(z);
%finding size after compressing the signal
b=size(xx);
%plotting the compressed signal;
subplot(4,1,4);
plot(xx);
title(‘plotting after compressing the signal’);
soundsc(xx,Fs);
13 B17EC015 06/27/2020
CODE
w_double=double(xx);
o_double=double(p);
%finding error
for j = 1:a;
s = s+(w_double(j)-o_double(j)) ;
end
display(s)
%finding root mean square error
s=s^2;
c=sqrt(s)
%finding signal to noise ratio
p=psnr(xx,p)
14 B17EC015 06/27/2020
OUTPUT
s =1.4825e-14
c =1.5e-17
p = 47.1516
15 B17EC015 06/27/2020
ADVANTAGES
Speech signal compression using DCT is quick.
It is useful for encoding speech at lower bit rate
DCT is widely used in transforms in image and audio
compression algorithm.
Its popularity is due mainly on the fact that it achieves a good
data compaction.
Performance wise DCT is better than DWT
16 B17EC015 06/27/2020
DISDVANTAGES
Wavelets and discrete wavelet transform works more
efficiently than DCT.
In this only some bits are compressed
Compression ratio in DCT is small when compared with DWT.
17 B17EC015 06/27/2020
APPLICATIONS
Compression of speech is used in digital cellular technology
where many users can share same frequency bandwidth at a
particular time.
It can also be used for digital voice storage that are used for
answering machines
18 B17EC015 06/27/2020
FUTURE SCOPE
19 B17EC015 06/27/2020
CONCLUSION
Speech signal compression can be done in many ways but
one of the simplest way of compression is by using discrete
cosine transform. In DCT we are finding the threshold
coefficients and reducing the size of speech signal.
There are many other transform and techniques that are used
for speech signal compression but the simplest way is by
using DCT.
20 B17EC015 06/27/2020
21 B17EC015 06/27/2020