Running head: DSP APPLICATIONS AND ARM TECHNOLOGY DSP APPLICATIONS AND ARM TECHNOLOGY Name of the Student Name of the University Author Note
DSP APPLICATIONS AND ARM TECHNOLOGY1 Table of Contents Introduction:...............................................................................................................................2 Methodology and obtained results:............................................................................................2 Part 1: Speech Vocoder programmed in MATLAB...............................................................2 MATLAB code for processing the 1st channel:......................................................................3 Part 2: Digital filter bank on ARM STM32F407 Discovery board......................................11 Equivalent C code for signal generation:.............................................................................17 Conclusions:.............................................................................................................................23 References:...............................................................................................................................24
DSP APPLICATIONS AND ARM TECHNOLOGY2 Introduction: This particular project is divided in two parts. The first part is the implementation of a speech Vocoder through MATLAB. The Vocoder is basically a software that can synthesize a sound by speech analysis and then produce the speech in a form which is known as the ‘Shannon Speech’. Basically at first in the Vocoder the sound is segmented into different channels and then the sound is rectified by half wave rectifiers. Then it is passed through various low pass filters and then additive Gaussian white noise is applied to each signal. Then the noise is filtered through some previously designed filter and finally the output signal is produced by summing all the filtered signals (Ahammed et al. 2015). This output signal gives clearer audio than the original signal. Now, the sampling rate that is used in the 3rd order Butterworth filter is 22.5 KHz as obtained while reading the sound wave in MATLAB. Although the different kinds of filters can be used to extract the cut off frequencies at 160 Hz, like 3rd and 6th order elliptical filter, Butterworth filter but investigating the different possibilities it is found that Butterworth produces low pass filtered signals better than any other method (Sandhu, Kaur and Kaur 2016). Now, the 3rd order elliptical filter is used in the initial analysis filter of different components of the sound signal (Podder et al. 2014). The filtered signals are compared based on their frequency spectrum also. Finally, the synthesised and summed up all the component sound wave is needed to be played with the sound function in MATLAB to find the difference between the original signal and the synthesized signal. In the second part a C/C++ code is needed to be designed which acts as a digital filter bank on the ARM STM32F407 Discovery board. As specified in the question the input signal to the A/D converter of the digital filter bank of the board is a superimposed three sinusoids of frequency 500 Hz, 1500 Hz and 2500 Hz respectively. This signal is generated in MATLAB first and the equivalent code in C is developed by MATLAB Coder. After that, among all the possibilities of different filters the 10th order Butterworth filter is used for filtering the individual frequency components as the stop-band Butterworth filter suppresses the stop-band frequencies into a lower level than other filters. The generalized equation of a Butterworth filter is given by (Podder et al. 2014), |H(jw)| = 1 √1+€2 (w ℘)2n (1) n= filter order, w = 2*π*f , wp = 2*π*fp, fp = pass band frequency. € = maximum pass band gain. Hence, the 10th order filter is given by putting n= 10 in equation (1). Now, for removing the individual frequency component 500, 1500 and 2500 Hz the stop band defined by [499 501], [1499 1501] and [2499 2501] respectively. Now, the after filtering all the signal components the final signal is displayed in MATLAB. Methodology and obtained results:
DSP APPLICATIONS AND ARM TECHNOLOGY3 Part 1: Speech Vocoder programmed in MATLAB In this part a MATLAB code for Vocoder is needed to be designed and this will be able to synthesize the sound from the input speech and then produce the ‘Shannon Speech’ (Morise, Yokomori and Ozawa 2016). The block diagram of the Vocoder is given below. Based on the targeted applications or languages the above block diagram can be a few different. The total system has the following indicative parameters as given below. 1.The input bandwidth must be between 0 to 11 kHz or there should be 22.05 kHz sampling rate at 16 bits. Hence, the chosen audio file is obtained from the internet known by the name “BassDrum001”. The sampling rate is divided by 2 to obtain the sampling rate of 22.05 kHz. 2.The number of channels are in between 1 to 24. Usually, the number is large for large duration voice signals. However, the chosen voice signal “BassDrum001” is of very small duration and hence it is segmented in only two channels. 3.The 3rd order elliptical filter is used here to filter the individual channels of main sound signal. MATLAB code for processing the 1st channel: function vocoder(N) % length of y must be exactly divisible by N, N=2 is recommended [y, Fs] = audioread('BassDrum001.wav'); soundsc(y, Fs) yseg = reshape(y,[length(y)/N,N]);
DSP APPLICATIONS AND ARM TECHNOLOGY4 y1= yseg(:,1); t1 = (0:length(y1)-1)./Fs; %time vector for y %plot of the sound wave: subplot(2,4,1) plot(t1,y1,'b'); title('1st segment sound and fft'); ylabel('1st segment 16-bit data'); xlabel('Time, s') %spectrum of the sound wave: y_fft_raw=abs(fft(y1)); % calculate fft y_fft=y_fft_raw/max(y_fft_raw); % normalise Faxis=linspace(0,Fs,length(y1)); % frequency axes array % plot the spectrum: subplot(2,4,5) plot(Faxis,y_fft,'b') title('power spectrum of the segment signal') xlabel('Frequency, Hz') ylabel('Normalised FFT power') axis([0 12000 0 1.1]); % [x_start x_end y_min y_max] % START VOCODER % STEP 0: APPLY ANALYSIS FILTER; order = 3; Rp = 3; %dB ripple in passband Rs = 40; %dB attenuation Wp = [334/(Fs/2), 1343/(Fs/2)]; % normalised passband [b,a] = ellip(order,Rp,Rs,Wp); yf = filter(b,a,y1); %filtered signal (after STEP 0): %Let's plot the sound wave: figure(2) subplot(2,2,1) plot(t1,yf,'b');
DSP APPLICATIONS AND ARM TECHNOLOGY5 title('filtered segment signal'); ylabel('16-bit data'); xlabel('Time, s') %Let's look at its spectrum now: yf_fft_raw=abs(fft(yf)); % calculate fft yf_fft=yf_fft_raw/max(yf_fft_raw); % normalise Faxis=linspace(0,Fs,length(y1)); % frequency axes array % plot the spectrum: subplot(2,2,3) plot(Faxis,yf_fft,'b') title('spectrum of filtered segment signal') xlabel('Frequency, Hz') ylabel('Normalised FFT power') axis([0 12000 0 1.1]); % [x_start x_end y_min y_max] figure(1) % STEP 1: APPLY HALF-WAVE RECTIFIER: yr = yf; %define yr = half-wave rectified signal for i=1:length(yr) if yr(i)<0 yr(i)=0; end %endif end %endfor %Let's plot the rectified sound wave: subplot(2,4,2) plot(t1,yr,'r'); title('half-wave rectified signal'); ylabel('16-bit data'); xlabel('Time, s') %Let's look at its spectrum now: yr_fft_raw=abs(fft(yr)); % calculate fft yr_fft=yr_fft_raw/max(yr_fft_raw); % normalise Faxis=linspace(0,Fs,length(y1)); % frequency axes array
End of preview
Want to access all the pages? Upload your documents or become a member.