How to shrink time scale for discrete signal?

2 visualizaciones (últimos 30 días)
Himanshu Sharma
Himanshu Sharma el 4 de Nov. de 2018
%if
bits = [1,0,1,1,0,0,0,1];
% Mapping
for a=1:length(bits)
if bits(a) == 1
bit(a) = 5;
else
bit(a) = -5;
end
end
i = 1;
t = 0:0.01:length(bits);
for b=1:length(t)
if t(b) <= i
y(b) = bit(i);
else
y(b) = bit(i);
i = i+1;
end
end
plot(t,y);
end
I am trying to change the duration of 1 bit from 1s to 1us and the scale would be 0 to 8us with a step of 1e-8. I am getting an error if I do it using this method and if I specify my own time scale it will only print the first value that goes from 0 to 1. Any ideas???

Respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by