Binärsignal transformation 100 [Hz] --> 2000 [Hz]

1 visualización (últimos 30 días)
julius bruns
julius bruns el 17 de Mzo. de 2023
Comentada: julius bruns el 20 de Mzo. de 2023
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

Respuestas (1)

Paul
Paul el 19 de Mzo. de 2023
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)
ans = 1×12
1 1 1 0 0 0 1 1 1 0 0 0
  1 comentario
julius bruns
julius bruns el 20 de Mzo. de 2023
Hi Paul, exactly what I was looking for. Thank you for your solution!

Iniciar sesión para comentar.

Categorías

Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by