How is the output size of UPFIRDN determined?
조회 수: 1 (최근 30일)
이전 댓글 표시
I want to understand resampling better, so I am trying to replicate the functionality of Matlab's built-in upfirdn() function. To clarify, I'm not looking for a fast implementation (at first), I just want to see how to get the exact same result. As such, I understand the basic steps (conceptually) are:
(1) Upsampling by P (zero insertion).
(2) FIR filtering.
(3) Downsampling by Q (throwing away samples).
This is fine. However, what is bugging me is that (as stated by Matlab help) the final output size is:
Ly = ceil( ((Lx-1)*P + Lh)/Q ) where Lx = length(X) and Lh = length(H)
and I don't understand why. With reference to the 3 stages listed above, a naive implementation might give stage-by-stage output sizes:
(1) P*Lx
(2) P*Lx
(3) floor(P*Lx/Q)
Therefore, I really want to know exactly what upfirdn is doing. Can anyone help?
댓글 수: 1
Bradford Watson
2021년 1월 29일
Whenever two sequences are convolved together, the length of the resulting sequence is Lx + Ly - 1. The inner part of this equation is expressing the length of the convolution of the upsampled sequence (Lx-1)*P and the filter length (Lh), though neglecting the -1 term. This is then divided by the decimation, and the ceiling function is taken to get rid of any fraction.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!