필터 지우기
필터 지우기

Hold multiple values in a signal

조회 수: 1 (최근 30일)
Nazmi Berk Çelik
Nazmi Berk Çelik 2022년 7월 21일
답변: Andy Bartlett 2022년 7월 21일
I=imread('model.jpg');
imshow(I);
K=imread('signal.jpg');
imshow(K);
M=imread('signal_points.jpg');
imshow(M);
I have a discrete signal which comes from zero order hold block. In each rise and falling edge point (time interval), I have to keep the value corresponding to those points until the end. I tried to extract these points and sent them to separate enabled subsystems. This method works but not efficient because of manual operation, that is, for example if i have 50 points, there has to be 50 enabled subsystems. I tried that I sent the separate signals to single enabled subsystem by defining trigger array but this ruins holding process in every trigger moment. What kind of method can i use for that?
As you can see from the figures, I have 12 points. And if I use 1 enabled subsystem, an overlapping is observed

답변 (1개)

Andy Bartlett
Andy Bartlett 2022년 7월 21일
These ideas may get you moving forward.
1)
In Simulink (unlike MATLAB) signals have fixed maximum lengths and most commonly the length is fixed. You need to design what you want to happen when the fixed limit is exceeded. Keep only the first N values? Keep only the last N values?
2)
For the implementation inside your triggered subsystem,
Use unit delays to hold on to two persistent values.
First, Integer valued scalar representing index_counter of which trigger this is. 0th, 1st, 2nd, ...
Second, vector of length N that holds up to N trigger values.
Feed the unit delay outputs back into themselves but with a little bit of logic on the feedback loop.
For example, feedback loop on index_counter should be increment the value whenever a new value is stored. And if using a circular buffer scheme, some logic to wrap the value back to zero when it exceeds N-1.
Feedback loop on vector signal would use indexing to change just one value in the vector

카테고리

Help CenterFile Exchange에서 Signal Generation에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by