# Signal Discrete Fourier Transform

Hi guys, i'm a bit embarassed that my first post here is in this section, but i'm taking a Elec. Eng. course abroad, which is out of my confort zone (i'm majoring in automotive eng.) and i'm trying to solve a few model problems. This one in particular deals with the DFT. Anyway:

## Homework Statement

Consider the signal: y= 2*sin(1.5*2*pi*t)

the signal is sampled with a sampling frequency fc=8 Hz, for a time of 1 second and using a rectangular window. plot the modulus of the Discrete Fourier Transform.

-----------

I'm completely lost... I think I have to determine N, using the fc and sampling time, so something like this:

fc=8 Hz => 8=1/T and therefore T(sampling time) = 1/8 s

Since the total sampling time is 1s, for 1s we have 8 samples and so N=8 ?

Is this correct, and if so, where do I go from here?

Thanks!

## Answers and Replies

Related Engineering and Comp Sci Homework Help News on Phys.org
vela
Staff Emeritus
Homework Helper
I'm not sure what the significance is of using the rectangular window. Hopefully, someone else will chime in and explain that.

In any case, you want to calculate what you'll get for the 8 samples. You'll have a sequence of 8 numbers {x0, x1, ..., x7}. You want to calculate the DFT of this sequence, which will result in a sequence of 8 complex numbers {y0, y1, ..., y7}. You want to plot the modulus of these numbers.

you have a temporal signal y defined by:

f0 = 1.5
y(t) = 2*sin(2*pi*f0*t)

where f0 is the fundamental frequency in Hz. That is, the sin wave oscillates at f0 cycles per second.

You are told to sample at Fs = 8 (Hz) for 1 (s). Notice that Fs > 2*f0 so you *are* satisfying Nyquist.

As you stated, Ts, the sampling interval is:
Ts = 1/Fs = 1/8 (s)

so yes, the total sampling time is 1 (s) and the number of samples is N = 8

So you can do this a couple of ways:

n = {0, 1, … , N - 1} = {0, 1, …, 7}
Form the discrete signal:
y'[n] = y(n*Ts) = 2*sin(2*pi*f0*(n*Ts))

You now take the DFT of the discrete signal y' such that:
Y = DFT{ y' }

Note that Y is a complex signal, so you'll need to take the magnitude.
Are you supposed to work this out by hand? If you are using MATLAB, you would plot this as:

figure;
f = linspace(0, Fs - Fs/N, N)
plot(f, abs(fft(y', N))

It's an odd way to phrase that you are using a rectangular window, seeing how it says to sample the signal, which you are doing. However, the process of obtaining y'[n] is equivalent to a rectangular window, since you are truncating the signal. Note that your original signal y(t) has an infinite time support (ie it is valid for all values of t)

If you are familiar with the rect function, then you are first forming a "new" time signal:

Tp = N*Ts
y'(t) = rect(t/Tp)*y(t)
and sampling this, and then performing the DFT.

You could also "chop" your original signal with a window (eg Hann, Taylor, ...). You could also create the y[n] signal and then apply the window in a discrete form.

Cheers for the help guys, exam was today and I passed it!

RE: the window. Some example problems were for the Hann window, others for the rectangular.