Sample Rate Converter

버전 1.0.1 (1.62 KB) 작성자: Ryan Black
Use this handy function to upsample or downsample a sampled signal.
다운로드 수: 61
업데이트 날짜: 2019/10/12

라이선스 보기

Function input takes sampled signal, b, old sample rate Fs, and wanted new sample rate Fsnwant. Function outputs resampled signal, bn, and actual new sample rate Fsn (rounding to nearest integer sample):

[bn,Fsn] = sampleconverter(b,Fs,Fsnwant)

The algorithm works by strategically inserting blank frequencies or removing frequencies about the Nyquist frequency of B while preserving conjugate structure of the frequency domain (input is typically real, so I operate to fully preserve Hermitian Symmetry with as little signal distortion as possible).

Noting how Nyquist behaves differently for even vs odd signal lengths (explicit vs implicit mirroring), we yield 4 upsample cases: {even to odd, even to even, odd to even, odd to odd} and likewise 4 downsample cases: {even to odd, even to even, odd to even, odd to odd}. Analysis reveals upsample cases 1 and 2 are the same, and 3 and 4 are the same. Frequency domain diagrams may help you to distinguish the 6 remaining distinct cases. After resampling we get new length, unscaled Bn.

We rescale Bn by the ratio of the new sample length to the old sample length (Nn/N), take the ifft of Bn and we have our answer!

인용 양식

Ryan Black (2024). Sample Rate Converter (https://www.mathworks.com/matlabcentral/fileexchange/73005-sample-rate-converter), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2019b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Multirate Signal Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.1

More comments, added to description.

1.0.0