Why am I getting "too many output arguments" when I am Quantizing an input speech?

1 次查看(过去 30 天)
clear
clc
%----------------- Quantization -------------------------------------------
%Number of level
level=32;
%TYPE OF QUANTIZATION
% Choose to graph:
% 1 = Univorm
% 2 = Mu-law
% 3 = A-Law
option_quantization=1;
%----------------- Modulation ---------------------------------------------
%TYPE OF MODULATION
% Choose to graph:
% 1 = BPSK
% 2 = QPSK
% 3 = BPSK and QPSK
option_modulation=3;
%Loading voice
[x,fm]=audioread('4.m4a');
%Fundamental frequency
N=floor(0.02*fm);
C=xcorr(x,N,'coeff');
N1=floor(0.002*fm);
[x0,vmax]=max(C(N+N1:2*N+1));
t0=(vmax+N1)/fm;
f0=1/t0;
fundamental_frequency=strcat(num2str(f0),' Hz');
%PLOT
%Plotting input signals (voices)
figure(1)
plot(x)
axis([ 0 4500 min(x) max(x) ])
title('Input signal 1');
% Playing voices
disp('Playing input signals');
soundsc(x,fm);
pause(3);
%Quantization
[y1, x2, errorquantization] = quantize(x,option_quantization, level);
%Quantization error
quantization_error = strcat(num2str(errorquantization),' %');
%Variables to plot
xg=x2; yq=y1;
xq=x; fmq=fm;
Error I am getting:

回答(1 个)

Yongjian Feng
Yongjian Feng 2021-11-26
It looks like quantize only returns one output, not 3
help quantize
  2 个评论
Adam Danz
Adam Danz 2021-11-26
@Zanobia Masih I removed the flag because this answer perfectly addresses your question. It looks like you have a new, more complicated question. You may be looking for the function quantiz but it's unclear what your inputs represent. Where did you get this code?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

标签

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by