What do these lines mean?

2 ビュー (過去 30 日間)
Mohamed Nedal
Mohamed Nedal 2015 年 8 月 25 日
編集済み: Walter Roberson 2015 年 8 月 25 日
Hi there, I want to know what do these two lines mean :
[q,v] = max(10*log10(p));
And
[s,f,t,p] = spectrogram(y,100,80,100,Fs);

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 8 月 25 日
p is a vector or an array. log10(p) is logarithm base 10. Multiply that by 10. If the result is a vector, return the maximum value of the vector into q and return the location the maximum value was found at in v. If the result is an array, return the maximum value of each column into q and return the location of the maximum value in each column in v.
10*log10(x) is often used to calculate decibels.
Equivalent code would be
[maxp, v] = max(p);
q = 10*log10(maxp);
  2 件のコメント
Mohamed Nedal
Mohamed Nedal 2015 年 8 月 25 日
@Walter Robertson: Thank you very much for your answer. I have a couple of questions please :
1. You said that if the result is an array, return the maximum value of each column into q and return the location of the maximum value in each column in v. DO you mean return the location of the maximum value in each "row" in v or in each "colum" ?
2. What about the command line ?
[s,f,t,p] = spectrogram(y,100,80,100,Fs);
Walter Roberson
Walter Roberson 2015 年 8 月 25 日
編集済み: Walter Roberson 2015 年 8 月 25 日
If you do not specify the dimension to work along and p is a 2D array, then [maxp, v] = max(p) would be equivalent to
for K = 1 : size(p,2)
[maxp(1,K), v(1,K)] = max(p(:,K));
end
That is, the maximum in each column.
I am not familiar with spectrogram() and I have to cut my lawn so I do not choose to study the topic at this time.

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

カテゴリ

Help Center および File ExchangeHilbert and Walsh-Hadamard Transforms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by