COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

• Email
• Follow

```Please, please I need help I need to give this coursework by Monday and I'm stuck :((

Show how a 100 Hz triangle wave can be generated using Fourier
Series. The code should allow appropriate graphs to be plotted in order
to allow investigation of how the waveform changes with increasing the
number of terms in the series.

```
 0

See related articles to this posting

```"orfeuszwp1 biskup" <orfeusz79@gmail.com> wrote in message <ho0cid\$grn\$1@fred.mathworks.com>...
> Please, please I need help I need to give this coursework by Monday and I'm stuck :((
>
> Show how a 100 Hz triangle wave can be generated using Fourier
> Series. The code should allow appropriate graphs to be plotted in order
> to allow investigation of how the waveform changes with increasing the
> number of terms in the series.
>

Hi, You should show people what you have done so far to attempt this on your own.

Wayne
```
 0

```"Wayne King" <wmkingty@gmail.com> wrote in message <ho0cu3\$ml6\$1@fred.mathworks.com>...
> "orfeuszwp1 biskup" <orfeusz79@gmail.com> wrote in message <ho0cid\$grn\$1@fred.mathworks.com>...
> > Please, please I need help I need to give this coursework by Monday and I'm stuck :((
> >
> > Show how a 100 Hz triangle wave can be generated using Fourier
> > Series. The code should allow appropriate graphs to be plotted in order
> > to allow investigation of how the waveform changes with increasing the
> > number of terms in the series.
> >
> > Many thanks in advance
>
> Hi, You should show people what you have done so far to attempt this on your own.
>
> Wayne

Well this what I have got so far

Fs = 100;                   % triangle wave frequency
T = 1/Fs;
t = 0:T:10;                % Sampling frequency
w=2*pi*Fs;
n=1;                         %nth term
a=1;                         %amplitude

%I have found this formula for triangle wave using
%fourier series

y= (8/((2*n-1)*(2*n-1)*pi*pi))*cos((2*n-1)*pi*t/2);

plot(t,y);
xlabel('time');
ylabel('Amplitude');

>it does plot a graph but I dont this that this is correct
```
 0

```"orfeuszwp1 biskup" <orfeusz79@gmail.com> wrote in message <ho0gpc\$rmp\$1@fred.mathworks.com>...
> "Wayne King" <wmkingty@gmail.com> wrote in message <ho0cu3\$ml6\$1@fred.mathworks.com>...
> > "orfeuszwp1 biskup" <orfeusz79@gmail.com> wrote in message <ho0cid\$grn\$1@fred.mathworks.com>...
> > > Please, please I need help I need to give this coursework by Monday and I'm stuck :((
> > >
> > > Show how a 100 Hz triangle wave can be generated using Fourier
> > > Series. The code should allow appropriate graphs to be plotted in order
> > > to allow investigation of how the waveform changes with increasing the
> > > number of terms in the series.
> > >
> > > Many thanks in advance
> >
> > Hi, You should show people what you have done so far to attempt this on your own.
> >
> > Wayne
>
> Well this what I have got so far
>
>
> Fs = 100;                   % triangle wave frequency
> T = 1/Fs;
> t = 0:T:10;                % Sampling frequency
> w=2*pi*Fs;
> n=1;                         %nth term
> a=1;                         %amplitude
>
> %I have found this formula for triangle wave using
> %fourier series
>
>  y= (8/((2*n-1)*(2*n-1)*pi*pi))*cos((2*n-1)*pi*t/2);
>
> plot(t,y);
> xlabel('time');
> ylabel('Amplitude');
>
> >it does plot a graph but I dont this that this is correct

Ok, without verifying your expression for the Fourier series, think about what a Fourier series is: it is a sum of terms. However, in your code you have n=1 so you are plotting only one term in the sum. If you want your Fourier series to approximate the function of interest, you have to sum over several terms. Think about how you can obtain terms in the series for several values of n and them sum the result.

Wayne
```
 0