Matlab Project Help

To get an insight of the quality of our Matlab Project Help you can go through the project that we have provided here.It is about speech compression. Signals are compressed by quantizing them to bit rate which is low when transmitting it but that degrades it. To decrease the degradation we apply the autoregressive model. The technique we have applied here is coding in a linear predictive way.

Speech Compression

This project deals with basic concepts in sound coding and quantization, subjects relevant for transmission and processing. The first step is to choose a suitable input, which should be downloaded from the reliable internet source to enable reproducibility. The signal that we have chosen lasts around 9 seconds (which is too long) and is sampled at full WAV quality (44.1 kHz, which is too high), which means some downsampling is needed to speed up the processing power. When down-sampled by a factor of five no significant degradation is registered subjectively. The signal is shown below:


The signal is very clear with little noise and no bias of the baseline.

Preprocessing the signal

The assignment begins with some useful preprocessing. The instructions specify the division of the signal into 160 sample blocks. The signal was padded with zeros Matlab project help  and divided into 548 full blocks speech compression reshaped into a matrix for convenient memorizing. After that, the signal is thresholded proportional to the number of signal standard deviations with a parameter alpha using the following formula:

The values that violate the above condition  Matlab coding project help are cut-off to avoid unnecessary stretching of the quantization intervals in the region that is scarcely populated by signal amplitudes. This essentially stems from the approximation of the signal distribution with a normal distribution, and we are cutting of the not-so-probable tails. Number of necessary bits for quantization and the appropriate value for parameter alpha remain variable parameters and they are adjusted by trial and error. The first time the code help with Matlab project is executed all the signals are listened to using the sound command. This command was commented out in later executions for time saving. The objective mean-squared errors of this quantization are shown in the table below:

B\ 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
1 0.00072856 0.00031261 0.00035111 0.00050773 0.00058999 0.0006127 0.00061533 0.00061575 0.0006158 0.00061582
2 0.00071877 0.00023878 0.00012258 0.00013219 0.00014446 0.00015092 0.00015217 0.00015242 0.00015246 0.00015246
3 0.00071457 0.00022005 6.6682e-05 3.8495e-05 3.7477e-05 3.8486e-05 3.8696e-05 3.8716e-05 3.8719e-05 3.8718e-05
4 0.00071238 0.00021493 5.0885e-05 1.4796e-05 1.0106e-05 9.7578e-06 9.7078e-06 9.7029e-06 9.6913e-06 9.6871e-06
5 0.00071194 0.00021258 4.6789e-05 9.0783e-06 3.2609e-06 2.5866e-06 2.4932e-06 2.4605e-06 2.4479e-06 2.4411e-06
6 0.00071194 0.00021205 4.5945e-05 7.7807e-06 1.5731e-06 7.8052e-07 6.6208e-07 6.2559e-07 6.1245e-07 6.065e-07
7 0.00071193 0.00021212 4.5584e-05 7.4232e-06 1.1429e-06 3.3887e-07 2.1456e-07 1.7783e-07 1.6474e-07 1.5793e-07
8 0.00071192 0.00021213 4.5588e-05 7.3164e-06 1.0415e-06 2.259e-07 1.0129e-07 6.4121e-08 5.0531e-08 4.4037e-08


Under the previously stated assumption of normal distribution of samples, the value of alpha=3 matches around 99% of all the samples that are included in the quantization unchanged. It is thus natural to notice almost no change for values of alpha above 3, especially for lower number of bits – the quantization error there dominates the total error compared to the thresholding error. Values below alpha=2 are also not behaving correctly according to the MSE table, as the inclusion of more bits doesn’t reduce the error further, which is all wrong – the total error is dominated by the thresholding error, which must not happen (the outlier removal should induce only a slight error).

clear variables
close all
%% Import audio file
%Since signal is stereo, extract jsut first channel
data=downsample(data(:,1),5);%also downsample
fs=fs/5;%reduce fs

The subjective quality of these recordings somewhat follows the distribution of MSE errors in the above table, but the acceptable Online Project Help in Matlab threshold of quality is around 4 bits and alpha=2.5. The values beyond that generated with increased parameters improve only slightly in quality.

Linear prediction

In linear prediction the MSE-optimal autoregressive model is fitted on an array of values representing a discrete signal. As a result, a very large number of sample values is replaced by a small number of filter coefficients. On the other hand, if the signal is too long, the approximation Matlab project help is very poor so the method introduces an unacceptable loss of information. This is why the division into blocks was initially performed – so that each block can get its own optimal AR model of order 10, which means we are substituting 160 values with Matlab coding project help only 10 coefficients and the initial value, creating a major compression of transmitted data. The AR models fit exceptionally well to speech data because of the zero-mean property and other characteristics. The errors of the AR approximation help with Matlab project are called residuals, and they can be obtained in two ways – by subtraction of predicted and true values, or by direct generation from a FIR filter. The two methods give the same result with a very small MSE between them (5.3207e-35) that is identically zero.

%% Linear prediction with autoregressive models
l=10; %length of autoregressive model
a=zeros(10,No_bl); %initialize coefficient matrix
e=zeros(N,No_bl);%initialize residual matrix
A=toeplitz([0,y(1:end-1,1)'],zeros(1,10)); matlab project help
%Initial coefficients and residuals
%Other coefficients and residuals
for k=2:No_bl
    %calculate coefficients and residuals

The creation of residuals via a filter can be reverse using a filter with an inverse transfer function. Unfortunately there is a lot of finite precision arithmetic involved, so a numerical error is introduced close to the double machine precision – the MSE of the reversal process is of the order of magnitude of 1e-15.

The error values are comparable to those  Matlab project help without quantization, so no numerical degradation actually occurs from this process. The residuals are too small for that, and the error is thus dominated by other sources. Unfortunately, occasionally instabilities cause individual values of filtered signal of order of magnitude 1e10, which can degrade the sound with occasional bursts, but can be easily removed, thresholded or filtered out. That is why we used median instead of mean in the code.

Quantizations of coefficients

When the coefficients are quantized alongside the residuals (which is a realistic case), the situation is much different. Even tiny changes can induce large instabilities, and such is the case with our signal and quantized filter. The slightly change values generate NaN and near infinite values at all three cases.


The quantization is very useful and  Matlab project help induces virtually no loss if we can preserve the coefficients of the IIR filter. In any other case, intricate knowledge of signal processing and filtration is needed to preserve the signal integrity through quantization and transmission through digital channels.