Question: I need to write a function from the MATLAB program provided bellow. 1.1 Write a function that must take 2 mono speech files (name in

I need to write a function from the MATLAB program provided bellow.

1.1 Write a function that must take 2 mono speech files (name in text string).

1.2 Your function must return 5 output data. Two outputs are the respective stereo outputs of the two inputs. The third output is the connected speech data the two inputs. Finally, the last two outputs are mono speech data, but with half of the data exchanged with that from the other input signal.

clear all; close all; clc;

cd('N:\EENG320');

[Sph1,Fs1]=audioread('TCAR01.wav');

figure(1)

subplot(2,2,1),plot(Sph1,'k'); title('Lab2-Lab2.3 result, a speech waveform');

y=flipud(Sph1)

subplot(2,2,2),plot(y,'r'); title('Lab2-2.6 result, a flipped speech waveform');

[Sph2,Fs2]=audioread('TDOV02.wav');

subplot(2,2,3),plot(Sph2,'b'); title('Lab2-3.1 result, a speech waveform');

Sph3= [Sph1;Sph2];

subplot(2,2,4),plot(Sph3,'g'); title('Lab2-3.2 result, a connected speech waveform');

audiowrite('ConnectedSph.wav',Sph3,Fs1)

% Step 4

Fs1 = round(Fs1/2)

audiowrite('Sph1HalfSR.wav',Sph1,Fs1)

Fs1 = round(Fs1/4)

audiowrite('SphFourthSR.wav',Sph1,Fs1)

% Step 5

[Sph1,Fs]=audioread('TCAR01.wav');

[Sph2,Fs]=audioread('TDOV02.wav');

audiowrite('Sph1Stereo.wav',[Sph1, Sph1],Fs)

audiowrite('Sph12Stereo.wav',[Sph2,Sph2],Fs)

audiowrite('Sph3Stereo.wav',[Sph1(1:49000),Sph2(1:49000)],Fs)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!