Tuesday, 26 April 2016

EXP 10 - Application

The aim of this experiment was to implement any Signal Processing operation on one dimensional Signal.
We formed a group of 5 students. The members were Nikita Pagar, Golappagouda Patil, Anushree Mhatre, Apoorva Raut and Sahil Rai. The topic we selected was “Detection and Processing of Electromyography signals”.

Title : EMG SIGNAL DENOISING VIA BAYESIAN WAVELET SHRINKAGE BASED ON GARCH

MODELING

Inventors : Maryam Amirmazlaghani, Hamidreza Amindavar

Description: Electromyography(EMG) is a biomedical signal which shows the muscle response to neural stimulation.It is very difficult to obtain high quality EMG signal from EMG sources as it has a very low amplitude and are very easily corrupted by noise. Hence it is necessary to filter out the noise before storing the signal digitally or before processing it.
This paper mainly concentrates on this issue of filtering noise out of an EMG signal using GARCH(Generalized Autoregressive Conditional Heteroscedasticity) modelling.



There has been considerable interest in using the wavelet transform as a powerful tool for processing EMG signals. In general, wavelet denoising procedures consist of three main steps: 
First, Calculate the wavelet transform of the noisy EMG signal. 
Second, Manipulate the wavelet coefficients. 
Third, Compute the inverse transform using the modified coefficients.
                   
DSPP_LAB

Friday, 22 April 2016

EXP 9 - Basic operations using DSP Processor

This was a demo experiment given by our Senior Jayganesh from BE EXTC. To start with the assembly language instructions was explained. This was followed by the instructions on using the code composer studio which is used for writing codes and debugging them.
A new project was created and a simple code was written to demonstrate various arithmetic and logical instructions in DSP processor. The output of the instructions was stored in the registers and these values were obtained in real-time using the debugging functionality of the software.

EXP 8 - Design of FIR filter using Frequency sampling method

We tried to write the code for this experiment in C code but the we couldn't get the desired output and hence we switched to Scilab.Again the plotting the magnitude was a pain in the neck but eventually we did manage to plot the spectrum using h(n).

The input specifications for two different cases were taken one for LPF and other for HPF. The magnitude and phase response for both the filters were plotted in scilab.
It was observed that there were lobes present in the magnitude spectrum in stop band for both cases. The phase spectrum was observed to be linear, and discontinous. The point of discontinuity corresponded to the frequency where the magnitude of the lobes was equal to zero and when the phase angle changed from pi to -pi.

EXP 7 - Design of FIR using Windowing method

In this experiment the filter was designed using code written in C language. The input specifications was taken from the user, There were 2 different codes for LPF/HPF and BSF/BPF. Specifications for one of each case taken and the filter was designed.
Different window functions were defined in the code and the function was selected during runtime based on the input specifications. After selection of window function h(n) was calculated. The magnitude and phase spectrum was then plotted in scilab using the obtained values of h(n). The phase spectrum of the filter for the filter was observed to be linear.

EXP 6 - Design of Chebyshev filter

In this experiment a scilab code was developed to design a digital Chebyshev filter by accepting the following specifications
  • Pass band attenuation(Ap<3dB)
  • Pass band frequency(Fp in Hz)
  • Stop band attenuation(As>40dB)
  • Stop band frequency(Fs in Hz)
  • Sampling frequency(Fs in Hz)
The analog Chebyshev filter was designed from the above specifications and then digital filter was obtained by BLT method.The magnitude response for the designed filter was obtained and the values of As and Ap were calculated from the response. The values were close to each other. Also from the magnitude response it was observed that there are ripples in the passband of the filter, The number of ripples depends on the order of the filter.
The pole zero plot of the transfer functions of both analog and digital frequency was obtained. For LPF the analog filter poles are on the LHS of the imaginary axis whereas digital poles were on the RHS of the imaginary. Also the digital filter were inside the unit circle.

EXP 5 - Design of Butterworth filter

In this experiment a scilab code was developed to design a digital butterworth filter by accepting the following specifications
  • Pass band attenuation(Ap<3dB)
  • Pass band frequency(Fp in Hz)
  • Stop band attenuation(As>40dB)
  • Stop band frequency(Fs in Hz)
  • Sampling frequency(Fs in Hz)
The analog filter was first designed using the input specifications. After designing the analog filter, digital was designed using BLT method. The values of Ap and As were verified from the obtained magnitude response. It was also observed that the magnitude response had a smooth monotonous curve.
The poles zero plot of analog and digital filter was also plotted. It was observed that for LPF the analog filter poles were on the LHS of the imaginary axis whereas the digital filter poles were on the RHS of the imaginary axis

PS: It took almost 3 weeks to learn Scilab and its functions. We tried to do all the computations by writing equations only to realize later that there are functions already available to directly calculate the transfer function of the filter by providing necessary inputs.

EXP 4 - OAM & OSM

OAM and OSM method is used filtering real life signals which may not as short as 4/8 point signals. In this method the signal is equally divided in short length signals and then convolution of these short length signals are obtained. The convoluted signals are then added to get the final output. 
As the signal is divided into N number of short length signals the effective number of calculations as well the time for computation reduces.

EXP 3 - FFT

FFT algorithm was implemented by creating a function for it. The signal was divided into two parts i.e odd and even part. Then computations were carried out on these two parts seperately. The even parts being added directly whereas the odd part was multipled was appropriate twiddle factor and then added. 
By sepearating the signal into odd and even parts and then coputing FFT reduces the total number of computations and also reduces the total time required for calculation.

NOTE:Similar to the DFT code in this code too sine and cosine functions are used for computation of FFT and hence including this library is mandatory.
           eg. gcc sample.c -lm
            where "-lm" is the command used to include math library.
Without this the code wouldn't compile even if the entire code is right.

EXP 2 - DFT

In this experiment a function was created to compute DFT and IDFT of an N point sequence , where the value of N and the sequence was taken as input from the user and was sent as an arguement that function.
The DFT of four point sequence was calculated and magnitude spectrum was obtained for it. Then the 4 point sequence was zero padded to make it an 8 point sequence and its magnitude spectrum was obtained. After comparing the magnitude spectrums we could conclude that the one with appended zeros had better resolution.

NOTE: Please do not forget to include math library while compiling the code as we have used sine  and cosine functions.
           eg. gcc sample.c -lm
            where "-lm" is the command used to include math library.
Without this the code wouldn't compile even if the entire code is right.

EXP 1 - Convolution & Correlation Algorithms


This experiment was divided into two parts 
1) Convolution algorithms
2) Correlation algorithms
1) ---> To start with we learned how to use terminal in LINUX system and also how to compile and execute programs using command prompt. After getting used to the command prompt we started with the actual C code for implementation of algorithms.
In the first part functions were created to compute linear and circular convolution of two signals . For linear convolution the number of values in the convoluted was equal to N+M-1  whereas for circular convolution it is max(N,M).
For circular convolution it was observed that it gives aliased output for L<N+M-1. For L=N+M-1 the circular convolution gives same output as of linear convolution
2) ---> In the second part functions were created compute correlation of two signals. The value at n=o of auto-correlated signal gives the energy of the signal, whereas the auto-correlated signal of delayed was delayed as compared to normal signal.
The output was also scaled by same factor when cross-correlation of input signal and scaled input signal was taken.