English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

MATLAB Transforms (Transforms)

MATLAB provides commands for handling transformations such as Laplace and Fourier transforms. Transformations are used as tools for simplifying analysis and viewing data from another perspective in science and engineering.

For example, the Fourier transform allows us to convert a signal represented as a time function into a frequency function. The Laplace transform allows us to convert differential equations into algebraic equations.

MATLAB provideslaplace,fourierandfftTransformation commands to handle Laplace, Fourier, and Fast Fourier Transform (FFT) commands.

Laplace transform

The Laplace transform of the time function f(t) is given by the following integral-

The Laplace transform is also known as the transformation of f(t) to F(s). You can see that this transformation or integration process converts the function f(t) of the symbolic variable t into another function F(s) with another variable s.

The Laplace transform converts differential equations into algebraic equations. To calculate the Laplace transform of the function f(t), please write-

laplace(f(t))

Exemplo

In this example, we will calculate the Laplace transforms of some common functions.

Create a script file and enter the following code-

syms s t a b w
laplace(a)
laplace(t^2)
laplace(t^9)
laplace(exp(-b*t))
laplace(sin(w*t))
laplace(cos(w*t))

Quando o arquivo é executado, ele exibe o seguinte resultado-

ans =
   1/s^2
ans =
   2/s^3
ans =
   362880/s^10
ans =
   1/(b + s)
  
ans =
   w/(s^2 + w^2)
  
ans =
   s/(s^2 + w^2)

Inverse Laplace transform

MATLAB allows us to use the following commands to calculate the inverse Laplace transformilaplace.

For example,

ilaplace(1/s^3)

O MATLAB executará a seguinte sentença e exibirá o resultado-

ans =
   t^2/2

Exemplo

Create a script file and enter the following code-

syms s t a b w
ilaplace(1/s^7)
ilaplace(2/(w+s))
ilaplace(s/(s^2+4))
ilaplace(exp(-b*t))
ilaplace(w)/(s^2 + w^2))
ilaplace(s/(s^2 + w^2))

Quando o arquivo é executado, ele exibe o seguinte resultado-

ans =
   t^6/720
ans =
   2*exp(-t*w)
ans =
   cos(2*t)
ans =
   ilaplace(exp(-b*t), t, x)
ans =
   sin(t*w)
ans =
   cos(t*w)

Transformada de Fourier

A transformada de Fourier geralmente transforma a função matemática do tempo f(t) em uma nova função, às vezes representada por F, cujos parâmetros são a frequência, unidade de ciclos/Segundos (Hertz ou radianos)/Segundos. A nova função é chamada de transformada de Fourier e/ou o espectro da função f.

Exemplo

Crie um arquivo de script e digite o seguinte código-

syms x 
f = exp(-2*x^2); % Nossa função
ezplot(f,[-2,2) % Plot da nossa função
FT = fourier(f) % Transformada de Fourier

Quando o arquivo é executado, o MATLAB desenha o seguinte gráfico-

Exibir o seguinte resultado-

FT =
   (2^(1/2)*pi^(1/2)*exp(-w^2/8))/2

Desenha a transformada de Fourier como-

ezplot(FT)

Para a figura a seguir-

Transformada Inversa de Fourier

O MATLAB ofereceifourierO comando usado para calcular a inversa da transformada de Fourier da função. Por exemplo:

f = ifourier(-2*exp(-abs(w)))

O MATLAB executará a seguinte sentença e exibirá o resultado-

f =
   -2/(pi*(x^2 + 1))