quantize/digitize wav file

조회 수: 2 (최근 30일)
jessica david
jessica david 2011년 3월 25일
how can I digitize/quantize .wav file in matlab
well, basically i am trying to modulate it,
[X, Fs, nbits] = wavread('filename');
M=16;
modulated_sig=qammod(X,M);
but it keeps giving me an error saying
??? Error using ==> qammod at 39 Elements of input X must be integers in the range [0, M-1]
  댓글 수: 1
jessica david
jessica david 2011년 3월 25일
I am guessing, i need to digitize it or something

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2011년 3월 25일
You need to quantize, just like you did for your generated signal in your earlier versions.
  댓글 수: 2
jessica david
jessica david 2011년 3월 25일
in the previous versions, X was of size N x 1; for a wav file, its size would be N x 2; and the function quantiz only takes N x 1;
it gives an error saying
??? Error using ==> quantiz at 32
The input signal must be a real vector.
Walter Roberson
Walter Roberson 2011년 3월 25일
http://www.mathworks.com/help/toolbox/comm/ref/qammod.html documents that if there are multiple rows in x that the columns will be processed independently, so it is fine to pass multiple columns to qammod. So just process the channels of the wav file through quantize independently and paste the result together:
qX = [quantiz(X(:,1),...,0:M-1), quantiz(X(:,2),...,0:M-1];
and pass qX to qammod.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Modulation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by