Question Regarding Digital Signal Processing - Voice Recording

1 view (last 30 days)
clear all
close all
clc
% Piece of code to Play Audio file
recobj=audiorecorder(8000,8,1,-1);%audiorecorder object with
samplerate,nbits,Number of channels & Device ID
disp('start speaking.') %waiting time to start speaking
recordblocking(recobj,5); %Recording voice for 5 seconds
disp('End of recording.'); % To stop end of recording
play(recobj); %command to play recorder object
y=getaudiodata(recobj); % store data in double-precision array
%plot(y) % Play back the record
% y1= y + rand(size(y)); %adding noise to Original Speech Signal
f=0.8;
n=6;
X1=fir1(n,f,'high'); %Fir High Pass Filter
X2=fir1(n,f,'low'); %Fir Low Pass Filter
X3=filter(X1,1,y); %Passing audio to designed High Pass Filter
X4=filter(X2,1,X3);
fvtool(X4,1); % Use to display designed Fir filter and it's Magnitude
Response
subplot(2,1,1)
plot(y) % Plotting Original Speech Signal
title('Original Speech Signal')
xlabel('Time')
ylabel('Amplitude')
subplot(2,1,2);
plot(X4) %Plotting Filtered speech signal
title('Filtered Speech Signal')
xlabel('Time')
ylabel('Amplitude')
I have this Piece of code working on voice Speech. I want to Quantize my original voice signal using Quantiz from syntax [index,quantized] = quantiz(samp,partition,codebook). when i try to ploty=getaudiodata(recobj);% store data in double-precision array vs quantized using stairs command to get quantized signal, i am getting error. How to do this?..

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!