Why does the "goertzel" function not accept arguments in [N, N + 1) as the FFT index for signal inputs of length N in MATLAB R2024a and earlier?
15 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2020 年 6 月 25 日
編集済み: MathWorks Support Team
2025 年 2 月 3 日 20:48
Why does the "goertzel" function not accept arguments in [N, N + 1) as the FFT index for signal inputs of length N in MATLAB R2024a and earlier?
Specifically, I get a "Maximum Index exceeds the dimensions of X." error when running the following code:
>> Fs = 8000;
>> N = 205;
>> lo = sin(2*pi*697*(0:N-1)/Fs);
>> hi = sin(2*pi*1209*(0:N-1)/Fs);
>> data = lo + hi;
>> goertzel(data,205.5)
Error using goertzel (line 143)
Maximum Index exceeds the dimensions of X.
Error in goertzel (line 100)
Y1 = goertzel(reshape(X,coder.internal.indexInt(size(X,2)),ONE),INDVEC,1);
採用された回答
MathWorks Support Team
2025 年 2 月 3 日 0:00
編集済み: MathWorks Support Team
2025 年 2 月 3 日 20:48
In MATLAB R2024a and earlier, the "goertzel" function only accepts arguments for the FFT index number over the interval [1,N] for a given signal input of length N.
Starting with MATLAB R2024b, the "goertzel" function now also accepts fractional inputs in [N, N + 1) as the frequency index. The workflow above should no longer error for versions of R2024b and later.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Spectral Estimation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!