A PCM-Based Vocoder/Decoder, a voice codec software based on PCM of voice signals to send over data network, whose quantizer provides both mid-rise and mid-tread quantization techniques, and an encoder with both Manchester and AMI signaling, providing the concept of AWGN channel, and regenerative repeaters.
fig. 1 PCM-based Vocoder/DecoderA function for each of the system blocks is required as follows:
-
The Sampler function, with the required sampling frequency as input.
-
The Quantizer function should have the option that the user chooses between:
- Mid-rise Uniform quantizer.
- Mid-tread Uniform quantizer.
For each, the user specifies the number of levels,
This function should also result in the following:
- A figure showing the input signal and the quantized signal, on the same plot, with proper legend.
Note: Display the input signal as a continuous signal, and display the quantized signal as a continuous staircase signal.
-
The value of the mean square quantization error, i.e.
$E{(m − ν)^2}$ . -
A stream of bits representing the quantized signal.
-
The Encoder function is required to represent the bit stream resulting from the quantizer as a signal. This function should have the option that the user chooses between:
- Manchester Signaling.
- Alternate Mark Inversion Signaling.
For each, the user specifies the pulse amplitude and the bit duration.
Note: that the bit duration is related to the sampling rate and the number of bits of the Quantizer.
- The Decoder function is required to transform received PCM coded pulses into a stream of bits, then transform each
$log_2(L)$ bits into a quantized sample.
This function should result in an output plot of the quantized samples. This function should have parameters matching those of the Quantizer and Encoder functions.
- The required sampling rate,
$f_s = 5 KHz$ . - The actual sampling rate after the downsampling,
$F_s = 4.8 KHz$ .
- Quantization Mode: Mid rise.
- Number of levels,
$L = 256$ .
- Line Code: Manchester Signaling.
- Pulse Amplitude,
$A = 5 volt$ . - Bit Rate,
$Rb = 10K bit/sec$ .
-
$Noise Power = 4 dB$ .
fig. 2 Input Signal vs. Quantized Signal
The following figure (Fig. 3) may show the output of the quantizer, and the difference between the input audio signal and the quantized signal more properly.
fig. 3 Input Signal vs. Quantized SignalBit stream (first 20 bits):
1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |
---|
fig. 4 Encoder Output
We can see that the line code properly matches the the quantizer output bit stream.
fig. 5 Channel Output
fig. 6 Regenerative Repeater Output
The regeneraative repeaters can successfully restore the PCM signal back from its noisy version. We can see that the output of the regenerative repeater is exactly the same as the output of the encoder.
fig. 7 Decoder Output (The Restored Signal)
The following figure (Fig. 8) may show the output of the decoder, the restored signal, more properly.
fig. 8 Decoder Output (The Restored Signal)Input Signal | Output Signal |
---|---|
input_audio.mov |
restored_signal.mov |
- The required sampling rate,
$f_s = 5 KHz$ . - The actual sampling rate after the downsampling,
$F_s = 4.8 KHz$ .
- Quantization Mode: Mid tread.
- Number of levels:
$L = 256$ .
- Line Code: AMI Signaling.
- Pulse Amplitude
$A = 5 volt$ . - Bit Rate,
$Rb = 10K bit/sec$ .
-
$Noise Power = 4 dB$ .
fig. 9 Input Signal vs. Quantized Signal
The following figure (Fig. 3) may show the output of the quantizer, and the difference between the input audio signal and the quantized signal more properly.
fig. 10 Input Signal vs. Quantized SignalBit stream (first 20 bits):
1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 |
---|
fig. 11 Encoder Output
We can see that the line code properly matches the the quantizer output bit stream.
fig. 12 Channel Output
fig. 13 Regenerative Repeater Output
The regeneraative repeaters can successfully restore the PCM signal back from its noisy version. We can see that the output of the regenerative repeater is exactly the same as the output of the encoder.
fig. 14 Decoder Output (The Restored Signal)
The following figure (Fig. 15) may show the output of the decoder, the restored signal, more properly.
fig. 15 Decoder Output (The Restored Signal)Input Signal | Output Signal |
---|---|
input_audio.mov |
restored_signal_2.mov |
The result in case of the mid-rise quantization technique with Manchester line code are the same as the case of mid-tred and AMI signaling.