How we can change a Duty Cycle for a signal
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Suppose A = 110101011; and i want to form rectangular wave with different duty cycle of each pattern and this pattern is repeating 1000 times. how can i plot this pattern
0 comentarios
Respuesta aceptada
Image Analyst
el 15 de Sept. de 2013
Do you have the Image Processing Toolbox, if so, just simply use imresize() to get the new pattern in the length that you want. Try this code:
A = [1,1,0,1,0,1,0,1,1];
newA = A; % Let's say the first cycle is the starting pattern.
for cycle = 1 : 3
% Get a random length for this pattern between 9 and 30
newSize = length(A) + randi(21, 1)
newPattern = imresize(A, [1,newSize], 'Nearest')
newA = [newA, newPattern]
end
2 comentarios
Vijender
el 15 de Sept. de 2013
Editada: Image Analyst
el 15 de Sept. de 2013
Image Analyst
el 17 de Sept. de 2013
What do you mean by different duty cycles? I took your pattern and basically stretched it out by a random factor. The duty cycle in A is the same, it's just longer or shorter in each random-length stretch of data that I added on. Is that not what you meant? To have a different duty cycle, you'd have to change what's in A, not just make A longer with the same pattern. If you want us to run your code, give typical values for inputs s and t.
Más respuestas (0)
Ver también
Categorías
Más información sobre Dialog Boxes 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!