how to decimate signal with fs 44100 into fs10k
조회 수: 4 (최근 30일)
이전 댓글 표시
hello everyone
how can i decimate a signal which fs is 44100 and i want the the fs is 10000???
i am getting the error (Resampling rate R must be a positive integer.)
clear all
close all
clc
fs=44100;
t=0:1/fs:5-1/fs;
f=200;
x=10*sin(2*pi*f*t);
d_x=decimate(x,4.41);
figure
subplot(211);
plot(t,x);
title("Orignal Signal,");
subplot(212);
plot(d_x);
title("Decimated Signal");
댓글 수: 0
답변 (1개)
dpb
2022년 6월 3일
편집: dpb
2022년 6월 4일
decimate does what the name says -- sets a factor of n fewer samples.
d_x=resample(x,10.0,44.1);
댓글 수: 3
dpb
2022년 6월 3일
That's because I cut 'n pasted and then didn't change your function name. As says in text, use resample instead of decimate. "Do what I mean, not what I say..." :)
참고 항목
카테고리
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!