How can I use obw function in App Designer?

1 回表示 (過去 30 日間)
Albert Chan
Albert Chan 2019 年 9 月 24 日
回答済み: Bhargavi Maganuru 2019 年 10 月 11 日
According to obw function described in https://www.mathworks.com/help/signal/ref/obw.html,
how can I apply it with UI.Axes in App Designer?
Thanks in advance!

回答 (1 件)

Bhargavi Maganuru
Bhargavi Maganuru 2019 年 10 月 11 日
obw” function without output arguments returns PSD plot in the current figure window and annotates the bandwidth. As gcf cannot return an App Designer figure and gca cannot return any axes within App Designer figure, so obw plot gets plotted in figure window outside App Designer and not in the UIAxes.
Instead you can plot PSD plot(using FFT) and annotate the bandwidth(using “obw”) in the UIAxes.
N = length(x);
xdft = fft(x);
xdft = xdft(1:N/2+1);
psdx = (1/(Fs*N)) * abs(xdft).^2;
psdx(2:end-1) = 2*psdx(2:end-1);
freq = 0:Fs/length(x):Fs/2;
plot(app.UIAxes, freq,10*log10(psdx));
And then annotate the bandwidth using output arguments of “obw” function and xline function
[bw,flo,fhi,power]=obw(x,Fs) % returns the lower and upper bounds of the occupied bandwidth and the occupied band power.
For more information about “obw” function refer to the link :https://in.mathworks.com/help/signal/ref/obw.html
Hope this helps!

カテゴリ

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

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by