Download Lab4 - Department of Engineering and Physics

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Student's t-test wikipedia , lookup

Transcript
ENGR 3302: Lab 4 (Two weeks lab)
Error Detection and Correction in Communication
An audio signal has been transmitted from Oklahoma to Washington in a noisy communication
channel. The noisy channel corrupts randomly the signs of some samples in the transmitted
audio signal. For example, the transmitted signal might be [-0.2 0.3 0.25 0.4 0.45] and the
received signal could be [-0.2 0.3 0.25 -0.4 0.45]. In this case the noise changed the sign of
the fourth sample from positive to negative.
To demonstrate some concepts in probability and statistics we will use the audio files
“BigDog” as the transmitted signal and the “NoiseBigDog” as the received signal. These files
can be downloaded from the course website to a folder in the computer. To load these files
from this folder to Matlab workspace use the following commands:
>> [TrnsSig, sr] = wavread(‘type folder path/BigDog.wav’);
>> [RecSig, sr] = wavread(‘type folder path/NoiseBigDog.wav’);
a) Assume the samples are transmitted as packets. Each packet consists of 50 samples.
Let us define the random variable X as the number of corrupted samples in a packet.
Use the transmitted and the received signals to construct the probability mass function
(pmf) of the random variable X for this communication channel by filling the table below.
x
0
1
2
3
…
…
49
50
p(x)
b) Find the mean and the standard deviation of the random variable X using the pmf
constructed in part a.
c) Let us define a new random variable S which consists of 5 binary bits. The five binary
bits represent the signs of 5 adjacent samples. The positive sign is represented by the bit
“1” and the negative sign is represented by the bit “0”. The sample space of this random
variable is
00000
00001
00010
00011
00100
:
:
11100
11101
11110
11111
Use the transmitted signal “BigDog” to construct the pmf for the random variable S.
s
00000
00001
00010
00011
…
…
11101
11110
11111
p(s)
Most of the energy in human speech resides on the vowels such as “O”, “A”, “E”, “I”. Vowels
are produced by relatively slow movement of our vocal track, so adjacent samples have the
same signs except when the sound waveform changes from a positive segment to a negative
segment. Therefore, the random variable S for vowels should have pattern where adjacent
bits are equal, such as 11111, 00000, or 11110. Consonants such as “f”, “sh”, “s” usually
cause air disturbance so the sound waveform fluctuate and adjacent samples change signs
more frequently. For consonants the patterns will be more like 10101 or 01010. Patterns such
as 11011 or 00100 will be less frequent. The patterns 11011 and 00100 mean the sign of the
middle sample is different from the signs of the two adjacent samples to its left and to its right.
Plot the pmf which p(s) verses s. Does the data in the pmf of the variable S support these
assumptions about vowel and consonants?
d) Use the physical property of the signal, statistical analysis, and probability to determine
the corrupted samples at the received signal and fix them by changing their signs. One
way to do that is to use the information in part c. If the sign patterns 11011 or 00100 in
speech are rare than go back to the received signal and change the sign of every sample
if it is different from the sign of the two samples to its left and the two samples to its right.
e) For the corrected received audio signal, construct the pmf and calculate the mean and
the standard deviation of the number of corrupted samples as you did in part a. Compare
the mean and the standard deviation to those calculated in part a. Does the sound
quality of the corrected received signal sounds better or worst than the non-corrected
received signal? Do the sounds qualities of the corrected and non-corrected received
signals agree with their calculated errors means?
Matlab functions
>> T = [0.1 0.2 0.15 -0.3 0.8 -0.8 0 0.1];
>> R = [0.1 0.2 -0.15 -0.3 0.8 +0.8 0 0.1];
>> E= (T==R) %will compare T and R and the output will be 1 for equal values 0 otherwise
E= 1 1 0 1 1 0 1 1
>> S = (T>=0) %will determine the sign of the sample and the output is 1 for positive and 0 for negative
S=1 1 1 0 1 0 1 1