How to matlab ztransform with time shift?

조회 수: 2 (최근 30일)
John Bravo
John Bravo 2018년 9월 20일
댓글: Star Strider 2018년 9월 21일
How to code z-transform with time shift. For example F(n) = (1/3)^n u(n-2) using symbolic math toolbox and other ways
  댓글 수: 3
John Bravo
John Bravo 2018년 9월 20일
Symbolic math toolbox. Are there other ways?
Star Strider
Star Strider 2018년 9월 21일
Signal Processing Toolbox, Control system Toolbox, System Identification Toolbox, perhaps others.
Try this:
syms n z
f(n) = (1/3)^n; % Discrete Domain
s(n) = heaviside(n-2); % Discrete Domain
F(z) = ztrans(f, n, z); % Z Domain
S = ztrans(s, n, z); % Z Domain
FS(z) = F * S; % Convolve To Get Shifted Function

댓글을 달려면 로그인하십시오.

답변 (1개)

Dimitris Kalogiros
Dimitris Kalogiros 2018년 9월 20일
If you like to use symbolic math toolbox :
clearvars; clc; close all;
% u(t) : 0 for n<0 and 1 for n>=0
oldparam = sympref('HeavisideAtOrigin',1);
syms n z
assume(n, 'integer');
assumeAlso(n>=0);
%time series
x(n)=( (1/3)^n )* heaviside(n-2)
% plot time series
fplot(x(n), '-b','LineWidth',3);
title(texlabel(x(n))); xlabel('n'), ylabel('x(n)')
% z-transform
X(z)=simplifyFraction( ztrans(x(n-2),n,z) )
If you execute this script:

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by