Sign in

username or email:

password:



Not a member?
Forgot your password?

Search code



Search tips


See Also

Embedded SystemsFPGA

DSP Code Sharing > Chaning the bit depth in speech samples

Chaning the bit depth in speech samples

Language: Scilab

Processor: Not Relevant

Submitted by Senthilkumar R on Dec 28 2011

Licensed under a Creative Commons Attribution 3.0 Unported License

Chaning the bit depth in speech samples


 

Read a speech signal and change the bit depth from 16 bits to 8 bits

 
//Caption: Reading a Speech Signal &
//[1]. Write it in another file
//[2]. Changing the bit depth from 16 bits to 8 bits
clear;
clc;
[y,Fs,bits_y]=wavread("E:\4.wav");
wavwrite(y,Fs,8,"E:\4_8bit.wav");
[x,Fs,bits_x]=wavread("E:\4_8bit.wav");
Ny = length(y); //Number of samples in y (4.wav)
Nx = length(x); //Number of samples in x (4_8bit.wav)
Memory_y = Ny*bits_y;  //memory requirement for 4.wav in bits
Memory_x = Nx*bits_x;  //memory requirement for 4_8bit.wav in bits
disp(Memory_y,'memory requirement for 4.wav in bits =')
disp(Memory_x,'memory requirement for 4_8bit.wav in bits =')
//Result
//memory requirement for 4.wav in bits =  
//     133760.  
//
//memory requirement for 4_8bit.wav in bits =  
//     66880.
 
Rate this code snippet:
0
Rating: 0 | Votes: 0
 
   
 
posted by Senthilkumar R



Comments


No comments yet for this code


Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )