Resampling of Discrete-Time Models

Available Commands for Resampling Discrete-Time Models

You can resample a discrete-time TF, SS, or ZPK model using the commands described in the following table.

To... Use the command...
  • Downsample a system.

  • Upsample a system without any restriction on the new sampling time.

d2d
Upsample a system with the highest accuracy when:
  • The new sample time is integer-value-times faster than the sample time of the original model.

  • Your new model can have more states than the original model.

upsample

Example of Resampling a Discrete-Time Model

This example shows how to upsample a system using both the d2d and upsample commands and compares the results of both to the original system.

  1. Create the original system, h1, by typing:

    h1 = tf([1 0.4],[1  -0.7],0.3)

    This command returns the following result:

    Transfer function:
    z + 0.4
    -------
    z - 0.7
     
    Sampling time: 0.3

    The sample time is 0.3 seconds.

  2. Create a new system with a sampling time of 0.1 seconds using the d2d command. Type::

    h2 = d2d(h1,0.1)

    This command returns the following result:

    Transfer function:
    z - 0.4769
    ----------
    z - 0.8879
     
    Sampling time: 0.1

    The sample time is 0.1 seconds.

  3. Create another new system with a sampling time of 0.1 seconds using the upsample command by typing:

    h3 = upsample(h1,3)

    This command returns the following result:

    Transfer function:
    z^3 + 0.4
    ---------
    z^3 - 0.7
     
    Sampling time: 0.1

    The sample time is 0.1 seconds and h3 has three times as many poles and zeros as h1.

  4. Compare the results of the new upsampled systems h2 and h3 to the original system h1. Use step response and bode plots by typing:

    step(h1,'-r',h2,':g',h3,'--b')
    figure
    bode(h1,'-r',h2,':g',h3,'--b')

    The step response plot shows that the upsampled system h3, created using the upsample command, provides a better match than h2 to the original system h1. The h3 system matches h1 at multiples of the original sampling time.

    The bode plot shows that the upsampled system h3, created using the upsample command, provides an exact match of the original system h1 up to the Nyquist frequency π / Ts0, where Ts0 is the sampling time of the original system.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS