フィルターのクリア

I have written a code please help me in getting the output .

1 回表示 (過去 30 日間)
Mubasher
Mubasher 2012 年 5 月 11 日
When i run this code i got a warninig that data cliped during write to file. Please sugggest something.
clear;
clc;
[data,Fs]=wavread('bird');
predictor = [0 1]; %%y(k)=x(k-1)
M=2;
freq_sep= 100;
nsamp=6;
fs=1000;
snr=0:1:25;
for i=1:1:length(snr)
partition = [-1 1];
codebook = [-1 .50 1];
% Quantize x using DPCM.
encodedx = dpcmenco(data,codebook,partition,predictor); %%modulated signal
fsk_mod=fskmod(encodedx,M,freq_sep,nsamp,fs);
noise=awgn(fsk_mod,snr(i));
fsk_demod=fskdemod(noise,M,freq_sep,nsamp,fs);
decodedx = dpcmdeco(fsk_demod,codebook,predictor);
[num,rate(i)]=biterr(encodedx,fsk_demod);
wavwrite(decodedx,Fs,8,'Bird')
sound('Bird')
end
semilogy(snr,rate)
  1 件のコメント
Daniel Shub
Daniel Shub 2012 年 5 月 11 日
While unrelated to the warning you are getting, I am pretty sure
sound('Bird')
is not valid MATLAB syntax

サインインしてコメントする。

採用された回答

Daniel Shub
Daniel Shub 2012 年 5 月 11 日
Wow, this question keeps coming up. The WAVWRITE function expects its input (in your case decodedx) to be an array with all values having a magnitude less than 1. You need to scale your decodedx.
See

その他の回答 (1 件)

Geoff
Geoff 2012 年 5 月 11 日
Is the output wave supposed to be 8-bit? That's exceptionally grungey... I don't use these wave file functions, but I expect that 'clipped' refers to the signal peaks getting chopped off due to a sampling issue. It could be that your source is 16-bit.
If you type:
class(decodedx)
Does it say uint8?

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by