Binärsignal transformation 100 [Hz] --> 2000 [Hz]
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello Community, I would like to talk to you with a simple problem which I unfortunately just can not solve. The basis is a binary signal with a frequency of 100 Hz. I would like to transform this signal to 2000 Hz. For example, the first value of my input signal has the value 1 --> the first 20 lines of my output signal have the value 1. The second value of my output signal has the value 0 --> lines 20 to 40 of the output have the value 0. My approach over 2 research loops, one with the values 1 to the length of the input value and a subordinate fo loop mi den values 1 to translation factor (output/input) unfortunately does not work. Thank you for your help! I look forward to hearing from you!
Eingangsfrequenz = 100;
Ausgangsfrequenz = 2000;
Eingang = SBO100HZ;
Berechnungsfaktor = (Ausgangsfrequenz/Eingangsfrequenz);
EA = 0;
BF = 0;
Ausgang = (zeros(1,length(Eingang)*Berechnungsfaktor))';
for EA = 1:length(Eingang)
for BF = 1:Berechnungsfaktor
Ausgang((1*EA)+BF-1,1) = Eingang(EA);
end
end
댓글 수: 0
답변 (1개)
Paul
2023년 3월 19일
Hi julius,
Does repelem meet the requirement. Here's a small example to repeat each element three times (instead of 20) to make it easy to see
x = [1 0 1 0];
repelem(x,3)
참고 항목
카테고리
Help Center 및 File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!