Issues with Simulink unit delay

20 views (last 30 days)
Robert
Robert on 11 Sep 2021
Answered: Paul on 11 Sep 2021
ok so apparenlty im stupid or something
all i want to do is phase shift a digital signal. Say i have a square wave signal that can change state every 1mili second.
It can go up or down and down and down or up and up. Think of i like the output of a sampe and hold.
I want to take that signal and shift it to the right by 500uS.
So when the original signal changes state either positive or negative i want the modified signal to follow suite but 500uS later.
I would of thought all i needed to do was a simple 1/z with a sample time of 500uS
However that is not the case.
I expect the modified signal to have the same period of 1mS just shifted.
For some reason when i add the delay of 500uS sometimes it delays it by 500uS other times it delays it by some other amount of time. but more importantly it changes the period of the modifed signal to something else???
I have no clue what is going on. All i want to do is phase shift the thing. I dont understand what im screwing up here.

Answers (1)

Paul
Paul on 11 Sep 2021
Using a unit delay is probably not what you want, because the output of the delay is held constant until the next sample time.
Instead, it sounds like what you want to use is a Transport Delay block. That block will delay its input by a fixed time, but the outupt might look odd to the eye depending on solver settings, other blocks in the model, how the input and output to the Transport Delay block is used, etc.

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!