How can i Resample?
조회 수: 3 (최근 30일)
이전 댓글 표시
I have two signals measured with different sampling frequencies
Signal 1 has a sampling frequency of 999.9917Hz while Signal 2 has a sampling frequency of 99.9976 Hz.
I would like to upsample signal 2 so that it has as many samples as signal 1.
who can i do this?
댓글 수: 0
채택된 답변
Youssef Khmou
2014년 4월 11일
hi,
You can use the resample function, to get the idea clear here is an example :
Fs1= 999.9917;
Fs2= 99.9976;
t1=0:1/Fs1:0.5-1/Fs1; y1=sin(2*pi*t1*300);
t2=0:1/Fs2:0.5-1/Fs2; y2=sin(2*pi*t2*30);
The resampling function uses two integers p,q to resample y2 by p/q*Fs2 as the new rate, thus Fs1=p/q*Fs2.
[p,q]=rat(Fs1/Fs2);
y3=resample(y2,p,q);
댓글 수: 2
추가 답변 (1개)
Azzi Abdelmalek
2014년 4월 11일
Use interp1
댓글 수: 2
Azzi Abdelmalek
2014년 4월 11일
편집: Azzi Abdelmalek
2014년 4월 11일
Do you want to add zeros to your signal2?
참고 항목
카테고리
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!