# fft

performs the fourier transformation of a signal without the lot of the usual hassle that is involved

## Contents

- Syntax
- Description
- Example

## Syntax

fft(y)

## Description

fft(y) Returns the fourier transformed of the vector y. The frist entry of this vector corresponds to the frequency content for . The System class manages a frequency vector that corresponds to the generated data. Using the setdf(df) method the resolution of the fouriertransform can be adjusted. Trailing zeros are automatically attached to y.

## Example

    clear; close all;
    s = System;
    s.addEntity(Nlevel(1),'qbit');
    s.addEntity(Qoscillator(3,1),'cavity');
    s.addCoupling('qbit','cavity',0.05);
    s.addDissipation('qbit',40);
    s.addDissipation('cavity',40);
    s.addExternalField(Gausspulse(0.04,50,15,1),'qbit'); %external laser pulse excites the system
    s.setTimestep(0.1);
    s.simulate();

    s.setdf(0.0001);
    plot(2*pi*s.f,abs(s.fft(s.getPolarisation('qbit'))));
    axis([0.8 1.2 -inf inf]);
    xlabel('Frequency');
    ylabel('abs(fft(Polarisation))');
    title('Qbit Coupled to a cavity');