Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to set the audio read from matlab to zero offset?

Status
Not open for further replies.

pradeept88

Newbie level 4
Newbie level 4
Joined
Mar 13, 2010
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
mysore
Activity points
1,326
Hi

please help me, i have recorded the sound from microphone using wavrecord instruction but i'm getting its slight below the zero offset please help me how to set it back to zero offset.

Here is my code.

Fs = 10000;
y = wavrecord(5*Fs,Fs,'double');
wavplay(y,Fs);
plot(y);


this program records sound of 5 seconds from microphone and samples tat at freq 10kHz and stores samples in array y.

But the plot i'm getting is not setted to zero offset plz help.

Thank U

With regards,
Pradeep
 

What do you mean by zero offset?
The range or y is -1.0 <= Y < +1.0
--
Amr Ali
 

i mean the speech is signal is not centered at zero on x-axis its centered at negative point.
 

It depends on the speech you are recording.
--
Amr Ali
 

but if i apply fft to this signal the response goes to negative.
 

Did you try values other than 'double'?
--
Amr Ali
 

Can you share your fft code?
--
Amr Ali
 

Ya here it is,

Fs=10000;
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(y,NFFT)/L;
f = Fs/2*linspace(0,1,NFFT/2+1);

% Plot single-sided amplitude spectrum.
plot(f,2*abs(Y(1:NFFT/2+1)))
title('Single-Sided Amplitude Spectrum of y(t)')
xlabel('Frequency (Hz)')
ylabel('|Y(f)|')

Added after 10 minutes:

for all the speech i read it starts frm negative so. fft output is zero.

Added after 2 minutes:

thank u for ur reply amar ali.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top