Matlab help Fast Fourier Transform

Discussion in 'Programmer's Corner' started by smarch, Feb 13, 2010.

  1. smarch

    Thread Starter Active Member

    Mar 14, 2009

    I'm a bit of a beginner at this sort of stuff, and was wondering if you guys could hep me understand this, and how to put it into matlab (below)
    Any additional information on FFT would be nice as I am struggling with this stuff.

    Many thanks.

    Create a function which returns a sine-wave of frequency f, amplitude A and phase delay theta and which lasts for a time T seconds, with a sampling frequency of fS. Thus write a function
    function [x, t] = single_sine(f, A, theta, T_end, fs);

    Get the function also to plot x for the time interval T_end seconds. Run for f = 10 Hz, A = 1, theta = 0, T_end = 3 seconds and fS = 1 kHz.

    For reasons that we shall return to you should define your time points to end at T_end–ts rather than TS. Thus

    t = 0:ts:T_end–ts;