Error using buffer Input must be a vector.

3 ビュー (過去 30 日間)
oscillator
oscillator 2022 年 2 月 17 日
回答済み: Star Strider 2022 年 2 月 18 日
...........................
[y,~]=audioread('ty.wav'); % there is no problem in plotting y. Howerver I must find a way to normalize the signal.
a=buffer(y,800,400)
% but it sais that y is not a vector so it doesn't work with the buffer. Can anyone help?
  2 件のコメント
Mathieu NOE
Mathieu NOE 2022 年 2 月 18 日
hello
what is the size of y ? you mention there is no problem in plotting ty , but we would like to see the plot of y and not ty.
all the best
oscillator
oscillator 2022 年 2 月 18 日
size(y)=97990 2.
I'm sorry, I made mistakes when I posted the question.
1st. I want to normalize the signal.
second : I ment I plotted y

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

回答 (1 件)

Star Strider
Star Strider 2022 年 2 月 18 日
If ‘y’ is a stereo signal, it is an (Nx2) matrix. Use buffer with each column individually. (This creates code problems because similar columns from both original vectors of the buffer output need to be kept together for processing. This is not difficult, however if only the most basic buffer result is desired, it might be easier to write a loop to process segments of both columns of ‘y’ together in each iteration, rather than having to refer to matching columns of the buffer output.)
With respect to ‘normalising’ the signal, see if the normalize or rescale functions will do what you want.

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by