How to find the start and end coordinates of main-lobe of rectangular window spectrum.

7 ビュー (過去 30 日間)
Palguna Gopireddy
Palguna Gopireddy 2022 年 12 月 28 日
編集済み: Palguna Gopireddy 2022 年 12 月 28 日
The rectangular window spectrum is found like
M=66;
r=rectwin(M);
n=512;
r_fft=fft(r,n);
r_fft2=fftshift(r_fft);
r_fftdB=20*log10(abs(r_fft2));
figure
plot(1:n,r_fftdB)
title(M)
The spectrum of the rectanular window spectrum (r_fftdB) is given by r_fftdB.
The plotted spectrum is
The spectrum is symmetrical about the peak of main-lobe. The starting of main-lobe is at coordinate 249. The ending of the main-lobe is at 265, The peak of main-lobe is at 257.
How to find the values of staring and ending coordinates of main-lobe (249,265 respectively)?
  2 件のコメント
Palguna Gopireddy
Palguna Gopireddy 2022 年 12 月 28 日
@KSSV, My question is to get the values of 249,265 ithout looking at the plot.

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

回答 (1 件)

Palguna Gopireddy
Palguna Gopireddy 2022 年 12 月 28 日
編集済み: Palguna Gopireddy 2022 年 12 月 28 日
I have tried this
M=66;
r=rectwin(M);
n=512;
r_fft=fft(r,n);
r_fft2=fftshift(r_fft);
r_fftdB=20*log10(abs(r_fft2));
[Max,I_max] = max(r_fftdB);
for i=I_max:-1:1
if r_fftdB(i)>r_fftdB(i-1)
start=i-1;
else
break;
end
end
for i=I_max:n
if r_fftdB(i)>r_fftdB(i+1)
ending=i+1;
else
break;
end
end
disp(start);
249
disp(ending);
265
Is there anyway we can get both the values in the same loop, so that the code-length and runtime minimizes?
Or
is there any other method to get these values?

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by