If I have no. of channels equal to 2.I have no. of samples equal to 1264896x2,but after resampling I got the value of no. of samples as 574x2.I am confused with it that whether I need to put 1264896 or 574 as no. of samples?Please do guide me?

1 view (last 30 days)
if bit rate=(File size in bytes X (8 bits/bytes))/(no. of samples x no. of channels).....

Accepted Answer

Walter Roberson
Walter Roberson on 4 Sep 2015
I recognize from your previous question that you are attempting to calculate bits per symbol.
The question becomes the bits per symbol for what ? When you use the file size, you are calculating the bits per symbol for the stored data, in whatever form the file happens to store them in. The file might be compressed. The file might use perceptual coding. The file might include a complete biography of everyone who played in the band, and 8719 pictures of the Stage Manager's pet ferret. The file size might be 183 gigabytes and only 52 bytes of that might have actually been devoted to the sound itself. But still, the calculation measures the average number of bits stored in the file per sample. And that is perfectly okay -- but it might not be a particularly useful number unless you place a lot of restrictions on the files to be considered.
You might be tempted to instead measure the size in bytes of the array used to store the samples read in. That is a much more useful measure, and leads to the exact parallel calculation after subsampling: the value after subsampling would relate to the size of the array used to store the subsampled values.
But before you get overly enthusiastic about the size of the array used to store the samples read in you have to understand that typically wavread() and related routines take the data stored in the file and convert it to double precision numbers in the range -1 <= x < 1 . You need to ask yourself whether you really need double precision to store the values. In rare circumstances you do, but typically not. A lot of sound file formats usually store the sound as 16 bit integers, so there is often only 16 bits of information in each double precision sample that you see. If you are interested in how much storage is really required to store the sound, you should really be looking at the 16 (or even 8, or 12) bits of information per sample. And for that purpose you should use the 'native' option when you read in the sounds, to get the samples in their original format from the file instead of in double precision format with all the wasted bits.

More Answers (0)

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!