How to add zeros on the end of a signal.

12 ビュー (過去 30 日間)
Matthew Tindall
Matthew Tindall 2016 年 11 月 17 日
編集済み: Adam 2016 年 11 月 17 日
please excuse me if this is an extremely simple question as i am new to matlab.
My code goes as follows:
[x, fs] = audioread('stereo.wav');
LeftChan = x(:,1); %extracting the left channel
RightChan = x(:,2);%extracting the right channel
LengthLeft = length(LeftChan);
%new another L here which adds the zero's to the end of L
ZeroPad = zeros(1,558);
NewLengthLeft = LengthLeft + ZeroPad;
n = 2048; %frame size
N = NewLengthLeft/n; %total number of frames
%Frames for Left Channel
for i = 1 : N
inputBuff = LeftChan((i - 1)*n+1 : i*n); %processing buffer
e = 0;
for j = 1 : n
e = e + inputBuff(j) * inputBuff(j);
end
end
i would like to add the zeros onto the end of the signal, however at the moment it doesnt seem to want to work.
Thanks in advance

採用された回答

KSSV
KSSV 2016 年 11 月 17 日
k = rand(100,1) ; % a random signal/ row vector
z = zeros(10,1) ; % a zero row vector
iwant = [k ; z] ;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by