1. Fourier Series

1.1. Playing with Fourier series using MATLAB

Solution: Since I do not have the matlab code yet, I use python to draw the following:

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator

# ex 1.1

# Generate x values from 0 to 10 with a step of 0.1
t = np.arange(0, 2, 0.01)

# Calculate the amplitude as the sine of the time values
f = np.zeros_like(t)
for n in range(5):
    amp = -15.0 / (1+n);
    phase = -0.1 * n
    f += amp * np.sin(2*np.pi*n*t + phase)

# Plot the sine wave
plt.plot(t, f)

# Add labels and title
plt.title('Sine wave')
plt.xlabel('Time')
plt.ylabel('Amplitude = sin(time)')
plt.gca().xaxis.set_major_locator(MultipleLocator(0.2))

# Add a grid and a horizontal line at y=0
plt.grid(True, which='both')
plt.axhline(y=0, color='k')

# Display the plot
plt.show()

1.2. Adding periodic functions

You can sometimes be misled by thinking too casually about modifying or combining periodic functions: scaling a periodic function results in a periodic function; shifting a periodic function results in a periodic function. What about adding?

(a) Let where and are positive integers. Is periodic? If so, what is its period?

Solution:

Yes, because apprantly . If , then .

I cannot prove it though.

(b) Let where and are positive rational numbers (say and , as fractions in lowest terms). Is periodic? If so, what is its period?

Solution:

Yes, the period is

(c) It’s not true that the sum of two periodic functions is periodic. For example, show that is not periodic. (Hint: Suppose by way of contradiction that there is some such that for all . In particular, the maximum value of repeats. This will lead to a contradiction.)

Proof:

Based on the hint, note that when , reaches its maximum, i.e. . Note assume , especially .

Then we have

This is not possible.

So is not a periodic function.

1.3 Periods of sums and products

Let and

(a) What is the period of ? Find the Fourier series for .

Solution:

The period of is , and the period of is . Since are coprime, then their common period has to be .

We use the conclusion from Understanding Analysis Exercise 8.5.2.

So

On the hindsight, we can just use the complex number knowledge in Appendix B to get this.

For the same reason

So

(b) Find the Fourier series for . What is the period of ? (The period of the product is more interesting. The product repeats every , that is, , so the period of is a divisor of . To determine the fundamental frequency of , we find its Fourier series.)

Solution:

From this Fourier series, we can see, is a period.

1.4 Different definitions of periodicity

(a) Show that is periodic of period if and only if for all . The upshot is that it doesn’t matter if we define periodicity as or as .

Proof:

If is periodic, then , let , then . So we have

The other side is the same.

(b) Show that is periodic of period if and only if for all .

Proof:

If is periodic, then , let , then . So we have

The other side is the same.

1.5. Overheard at a problem session ...

Suppose two sinusoids have the same frequency but possibly different amplitudes and phases. What about their sum? Each of the following answers was proposed at a problem session:

(a) Has twice the frequency of the original sinusoids.

(b) Is either zero or has exactly the same frequency as the original sinusoids.

(c) May exhibit beats.

(d) Is not necessarily periodic at all.

Which is correct, and why? (Hint: Think in terms of complex exponentials.)

Solution: This is covered at the end of Appendix B.

1.6. Low voltage

A periodic voltage is given by

Regardless of the frequencies , , the maximum voltage is always less than , but it can be much smaller. Use MATLAB (or another program) to find the maximum voltage if Hz and Hz.

Solution:

Here is the python code

t = np.arange(0, 2, 0.01)

f = 3 * np.cos(2 * np.pi * 2 * t - 1.3) + 5 * np.cos(2 * np.pi * 1 * t + 0.5)
plt.plot(t, f)
plt.show()

print(max(np.around(f, 4)), min(np.around(f, 4)))
5.7807 -7.6865

1.7. Periodizing a triangle

The triangle function with a parameter is

We’ll be seeing it a lot. When (the model case in many instances), we simplify the notation to just .

Note that .

The parameter specifies the length of the base, namely . Alternately, determines the slopes of the sides: the left side has slope and the right side has slope .

Now for define

Anwser:

(a) For and , sketch the graphs of . Periodic? In each case what is the period?

Solution:

The period are respectively.

(b) In which of these cases is it possible to recover the original signal from the sum ? What operation would you apply to to do this?

Solution:

When . We can times with the following

(c) In general, what condition on and will guarantee that can be recovered from the sum ?

Solution:

In general, we need .