Command for filling in zeros as powers of 2 for FT

3 ビュー (過去 30 日間)
FW
FW 2019 年 4 月 8 日
編集済み: FW 2019 年 4 月 11 日
If we two sets of signals (A and B) of unequal length, I am using zero padding first to make the length of B equal to A by using B_new = [B zeros(1,(length(A)-length(B)))]. This step is necessary because we would like to divide A by B in the frequency domain. Before the division process, I would like to make the length of A and B equal to a power of 2. What command should we use in MATLAB 2017b? If there is a better way to combine these two steps as well? Thanks

採用された回答

Matt J
Matt J 2019 年 4 月 9 日
N=nextpow2(max(numel(a),numel(b)));
A=fft(a,N);
B=fft(b,N);
  2 件のコメント
FW
FW 2019 年 4 月 9 日
編集済み: FW 2019 年 4 月 11 日
Thanks for the combined function. Just a clarification, what are small "a" and "b"s? My time domain raw signal was labelled A and B in the original post. Should I write it as:
N=nextpow2(max(numel(A),numel(B)));
FFT_A=fft(A,N);
FFT_B=fft(B,N);
Matt J
Matt J 2019 年 4 月 9 日
Yes.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by