## How Propagation Affects Inherited Sample Times

During a model update, for example at the beginning of a simulation, Simulink® uses a process called sample time propagation to determine the sample times of blocks that inherit their sample times. The figure below illustrates a Discrete Filter block with a sample time period `Ts` driving a Gain block. Because the output of the Gain block is the input multiplied by a constant, its output changes at the same rate as the filter. In other words, the Gain block has an effective sample rate equal to the sample rate of the filter. The establishment of such effective rates is the fundamental mechanism behind sample time propagation in Simulink.

### Process for Sample Time Propagation

Simulink uses the following basic process to assign sample times to blocks that inherit their sample times:

1. Propagate known sample time information forward.

2. Propagate known sample time information backward.

3. Apply a set of heuristics to determine additional sample times.

4. Repeat until all sample times are known.

### Simulink Rules for Assigning Sample Times

A block having a block-based sample time inherits a sample time based on the sample times of the blocks connected to its inputs, and in accordance with the following rules:

RuleAction
All of the inputs have the same sample time and the block can accept that sample timeSimulink assigns the sample time to the block
The inputs have different discrete sample times and all of the input sample times are integer multiples of the fastest input sample timeSimulink assigns the sample time of the fastest input to the block . (This assignment assumes that the block can accept the fastest sample time.)
The inputs have different discrete sample times, some of the input sample times are not integer multiples of the fastest sample time, and the model uses a variable-step solverSimulink assigns a fixed-in-minor-step sample time to the block.
The inputs have different discrete sample times, some of the input sample times are not integer multiples of the fastest sample time, the model uses a fixed-step solver, and Simulink can compute the greatest common integer divisor (GCD) of the sample times coming into the blockSimulink assigns the GCD sample time to the block. Otherwise, Simulink assigns the fixed step size of the model to the block.
The sample times of some of the inputs are unknown, or if the block cannot accept the sample timeSimulink determines a sample time for the block based on a set of heuristics.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8999045,"math_prob":0.9790226,"size":2514,"snap":"2023-40-2023-50","text_gpt3_token_len":518,"char_repetition_ratio":0.25139442,"word_repetition_ratio":0.12864077,"special_character_ratio":0.18575974,"punctuation_ratio":0.064444445,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97606796,"pos_list":[0,1,2],"im_url_duplicate_count":[null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-10-03T21:44:42Z\",\"WARC-Record-ID\":\"<urn:uuid:44bbdd36-4508-4b7c-aa72-bd987c968efc>\",\"Content-Length\":\"71180\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:f7909841-ff47-43c5-9849-ec95b0230794>\",\"WARC-Concurrent-To\":\"<urn:uuid:c440f1e9-ba04-49a8-8060-78dd5bcb8ceb>\",\"WARC-IP-Address\":\"23.34.160.82\",\"WARC-Target-URI\":\"https://ch.mathworks.com/help/simulink/ug/how-propagation-affects-inherited-sample-times.html\",\"WARC-Payload-Digest\":\"sha1:DFYZS3TR7PUZPKAXSM6QQSTRSGJSZCEX\",\"WARC-Block-Digest\":\"sha1:B4CAYTU3SXSXBU2OZBKW2U3AZOL5WKPE\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233511220.71_warc_CC-MAIN-20231003192425-20231003222425-00573.warc.gz\"}"}