フィルターのクリア

Signal is not properly sampling at the rising edge of clock.

1 回表示 (過去 30 日間)
Sarfaraz Ahmed
Sarfaraz Ahmed 2018 年 10 月 7 日
編集済み: Sarfaraz Ahmed 2018 年 10 月 7 日
Hi. I am sampling my input signal of frequency 50hz at the rising edge of clock and I am using simulatin time to sample my input. I am using simulation time because I have to introduce some delay later on clock.but it sample every time at zero. I am attaching my simulink model plus my sampler code below. The sampler block is inside of triggered subsystem. It seems it does not sample properly. Please help me in that model so I can solve this problem. Also can I use "pulstran" function instead of ideal clock ? If it does not work.
function Vin = sample(ip) coder.extrinsic('stem'); coder.extrinsic('get_param') persistent x1;
if isempty(x1) % Initialization x1=0; end
f=50; % input signal frequency sim_t=get_param('check','SimulationTime')
x1=sin(2*pi*f*sim_t);
stem(sim_t,x1); % plotting discrete samples on the input signal1
Vin=x1;
Thanks

回答 (0 件)

カテゴリ

Help Center および File ExchangePrepare Model Inputs and Outputs についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by