What does the 'audioread' function actually do?
이전 댓글 표시
I have a .wav file exported by a vibration analyser Svan 958A. It contains data from 4 channels. The samples are written in hexadecimal representation.
I read the file by executing the following line: [data,fs] = audioread('svan0004.wav','native'). MATLAB correctly organises the data in an 4-column array. Since the file was obtained at 24 bits per sample, the output array elements are of the type int32.
However, there is something wrong with the reading/extraction of the sample values from the .wav file. The first 4 values of each column are known to me, because they include the data definitions for each channel. By looking at those values I realised that somehow MATLAB did not convert the sample hexadecimal numbers as I was expecting. Here is what I get. The following values are the first 4 extracted values for the 4 channels:
Channel 1: [256, 512, 4199168, 0];
Channel 2: [512, 512, 4199168, 0];
Channel 3: [768, 512, 4199168, 0];
Channel 4: [1024, 512, 4452608, 0];
The following values are what should have been read:
Channel 1: [1, 2, 16403, 0];
Channel 2: [2, 2, 16403, 0];
Channel 3: [3, 2, 16403, 0];
Channel 4: [4, 2, 17393, 0];
Could you explain me what does the 'audioread' function actually do? What is the way around this? How can I extract the sample values correctly from my .wav file?
Thank you for the support. Best regards, Pedro Ochôa
댓글 수: 1
José-Luis
2016년 7월 7일
Divide by 256?
Have you read the documentation on audioread()?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!