Main Content

Oversampling factor

Oversampling value

Model Configuration Pane: Global Settings


Use this parameter to manually specify an oversampling value, which is the factor by which the global clock signal is a multiple of the base rate at which the model operates

By default, HDL Coder™ does not generate a global oversampling clock. To generate a global oversampling clock, specify an integer greater than 1. If you use a multirate DUT, make sure that other rates in the DUT divide evenly into the global oversampling rate.

The global oversampling clock affects only the generated HDL code. It does not affect the simulation behavior of your model.


  • To enable this parameter, clear Treat Simulink rates as actual hardware rates.

  • If you use multiple clocks, you must set Oversampling factor to 1. If you want to use an oversampling value greater than one, set Clock inputs to Single.

  • If you set Oversampling factor to a value greater than 1, make sure that the clock-rate pipelining optimization is enabled. You can specify this setting in the HDL Code Generation > Target and Optimizations > Pipelining tab.

    Clock-rate pipelining uses the Oversampling factor parameter to convert the slow regions in your model that operate at the base sample rate to the faster clock rate.


1 (default) | integer greater than or equal to 1

Default: 1


To set this property, use the functions hdlset_param or makehdl. To view the property value, use the function hdlget_param.

For example, you can specify this property when you generate HDL code for the symmetric_fir subsystem inside the sfir_fixed model by using either of these methods:

  • Pass the property as an argument to the makehdl function.

    makehdl('sfir_fixed/symmetric_fir', ... 
  • Set the parameter on the model by using hdlset_param, and then generate HDL code by using makehdl.


Recommended Settings

No recommended settings.

Programmatic Use

Parameter: Oversampling
Type: int
Value: integer greater than or equal to 1
Default: 1

Version History

Introduced in R2012a