09.06.2013 Views

Fourier Analysis - Redes de Computadores - UPV

Fourier Analysis - Redes de Computadores - UPV

Fourier Analysis - Redes de Computadores - UPV

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

In the right, the required information to perform the <strong>Fourier</strong> analysis is shown (The<br />

transmitted character, transmission speed and channel bandwidth (BW). Also additional<br />

info is presented as the time of one bit, the signal period, the fundamental frequency and<br />

the number of passing harmonics.<br />

In the top of the window the input signal (in blue) an the output signal (received signal)<br />

are shown. The input and output signals are <strong>de</strong>fined by byte(x) and s(x) functions,<br />

respectively.<br />

In the bottom, the frequency domain of the received signal is shown. Every harmonic is<br />

represented by a vertical red line. The position of each harmonic in the X-axis<br />

represents its frequency and its amplitu<strong>de</strong> corresponds with the power of this harmonic.<br />

We can observe that channel bandwidth is marked by a vertical blue arrow, just on the<br />

cut frequency (fc).<br />

Programming section: How to compute the a0, an and bn coefficients.<br />

Firstly, you have to edit the <strong>Fourier</strong>.cpp file and take a first look. The first functions<br />

have only <strong>de</strong>fined their hea<strong>de</strong>r, being their body empty:<br />

double a(int n, int caracter)<br />

{<br />

// IMPLEMENTAR<br />

}<br />

double b(int n, int caracter)<br />

{<br />

// IMPLEMENTAR<br />

}<br />

double a0(int caracter)<br />

{<br />

// IMPLEMENTAR<br />

}<br />

The two first functions are the ones that calculate the an and bn coefficients. For that<br />

purpose, use the equations (9) and (10), where the input argument, n, specifies the<br />

harmonic or<strong>de</strong>r. Using the following expression bit(caracter,i) you can get the value of<br />

bit(i). The third function is about the a0 calculation which can be done through the use<br />

of expression (8). In or<strong>de</strong>r to return the results in all these functions you have to use the<br />

return command.<br />

Alter implementing the above functions, we will <strong>de</strong>bug the program and verify its<br />

correctness. To call compiler in Linux:<br />

gcc <strong>Fourier</strong>.cpp –o Mi<strong>Fourier</strong> –lm<br />

7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!