Вы находитесь на странице: 1из 6

`

PROJECT REPORT

FOR

DIGITAL SIGNAL PROCESSING

(UEC502)

Submitted by:
Bhaskar Gupta [101615032]
ENC - 2

Electronics and Communication Engineering Department


Thapar Institute of Engineering and Technology, Patiala
July – December 2018
`

EXPERIMENT

AIM:​​ ​Write a program to read in a speech file and filter it to bandwidth of 5.5KHz, 4KHz and
3.2KHz. Listen to each of the resultant filter speech files and describe the effect of low pass
filtering on speech intelligibility and quality.

SOFTWARE USED​​: ​MATLAB R2016b

CODE:
clc
clear all

% load data from speech file file


file_name = 'audioBhaskar.wav';
[data, SamplingRate] = audioread(file_name);
timeArr = (0:length(data)-1)/SamplingRate;

N = 100; % FIR filter order


Fp_filter1 = 5.5e3;% kHz passband-edge frequency
Fp_filter2 = 4.0e3;
Fp_filter3 = 3.2e3;
Fs = SamplingRate; %sampling frequency
Rp = 0.01; % Corresponds to 0.01 dB peak-to-peak ripple
Rst = 80; % Corresponds to 80 dB stopband attenuation (0.01% leakage
of the frequency in stopband)

% designing filters
filter1 = dsp.LowpassFilter('DesignForMinimumOrder',false, ...

'FilterOrder',N,'PassbandFrequency',Fp_filter1,'SampleRate',Fs,...
'PassbandRipple',Rp, 'StopbandAttenuation',Rst);
fvtool(filter1,'Fs',Fs,'Color','White') % Visualize filter

filter2 = dsp.LowpassFilter('DesignForMinimumOrder',false, ...


`

'FilterOrder',N,'PassbandFrequency',Fp_filter2,'SampleRate',Fs,...
'PassbandRipple',Rp, 'StopbandAttenuation',Rst);
fvtool(filter2,'Fs',Fs,'Color','White')

filter3 = dsp.LowpassFilter('DesignForMinimumOrder',false, ...

'FilterOrder',N,'PassbandFrequency',Fp_filter3,'SampleRate',Fs,...
'PassbandRipple',Rp, 'StopbandAttenuation',Rst);
fvtool(filter3,'Fs',Fs,'Color','White')

% applying filters
processed_data1 = filter1(data);
processed_data2 = filter2(data);
processed_data3 = filter3(data);

% visualising the differences


subplot(4,1,1)
plot(timeArr,data)
xlabel('time')
ylabel('amplitude')
subplot(4,1,2)
plot(timeArr,processed_data1)
xlabel('time')
ylabel('amplitude')
subplot(4,1,3)
plot(timeArr,processed_data2)
xlabel('time')
ylabel('amplitude')
subplot(4,1,4)
plot(timeArr,processed_data3)
xlabel('time')
ylabel('amplitude')
`

RESULT:

The effect of low pass filtering on speech intelligibility and quality:

• At 5.5KHZ –​​ The background noise was a bit affected which improved the speech quality
a little.

• At 4KHZ –​​ We are able to identify that the background noise is suppressed. Amplitude of
high frequencies reduced to great extent although, original speech got also suppressed a
little
• At 3.2KHZ –​​ A huge improvement in the quality was observed. Background noise is
suppressed upto great extent but we also observe original signal got suppressed.
`
`

Вам также может понравиться