Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me understand this spectrum of signal problem

Status
Not open for further replies.

rkk76

Newbie level 3
Joined
Sep 18, 2005
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,311
spectrum of signal

Hey
can someone help me to understand this problem.
Sinusoidal signal x(n) = sin(n/4) with 0<n<7. I have find spectrum for x(n) using DFT with N=128. matlab program. Thanks for help
 

Re: spectrum of signal

Have u find out the spectrum of the signal by DFT or want to know how to find out. Make your question clear.
 

Re: spectrum of signal

In spectrum analysis of signal x
yuor signal is shot and you can consider it as
x=sin(n/4)×ones(1,7)
ones(1,7) is rectangular Window from 0 to 7;
dft of sin function is delta and dft of window is Sinc function therefor
dft(x)=convolution(delta_functin ,Sinc_Function )
 

Re: spectrum of signal

rkk76 said:
Hey
can someone help me to understand this problem.
Sinusoidal signal x(n) = sin(n/4) with 0<n<7. I have find spectrum for x(n) using DFT with N=128. matlab program. Thanks for help

As there are some lack of undestanding I figured out that you want the code to calculate the DFT with N=128 for x(n) = sin(n/4) with 0<n<7.

Here it comes;

>> n=[0:7]; % the number of points of the signal
>> xn = sin(n/4);% the required function
>> Xn=abs(fftshift(fft(xn,128)))/length(n); % the DFT with 128 points
>> N=[-64:63]*2*pi/128; % time scale to se the FFT from -pi to pi
>> plot(N,Xn); % the plot itself

Is it correct ???
 

Re: spectrum of signal

claudiocamera said:
rkk76 said:
Hey
can someone help me to understand this problem.
Sinusoidal signal x(n) = sin(n/4) with 0<n<7. I have find spectrum for x(n) using DFT with N=128. matlab program. Thanks for help

As there are some lack of undestanding I figured out that you want the code to calculate the DFT with N=128 for x(n) = sin(n/4) with 0<n<7.

Here it comes;

>> n=[0:7]; % the number of points of the signal
>> xn = sin(n/4);% the required function
>> Xn=abs(fftshift(fft(xn,128)))/length(n); % the DFT with 128 points
>> N=[-64:63]*2*pi/128; % time scale to se the FFT from -pi to pi
>> plot(N,Xn); % the plot itself

Is it correct ???

hi claudiocamera, can u tell me in "Xn=abs(fftshift(fft(xn,128)))/length(n); " why it is divided by length(n)? thanks
 

spectrum of signal

It depends of the definition adopted by the FFT some author divide by n ( the lenght of the discrete signal) in the sintesys equation, some divide by n in the analysis equation, some divide both sides by the square root of n. It depends how you define the DFT and inverse equations. Matlab implemented the FFT function in the way that for the given problem you need to peform this division. Note that in the result you dont have the transform of sin(t) I mean two delta function in mirrored frequencies, It happened because the number of point considered with 0<n<7 was not enought to get a full cicle.
 

spectrum of signal

hi claudiocamera,
you mean that so long as the data covers integers of cycles then it is not necessary to divide the fft by length(n)?

thanks
 

spectrum of signal

No, the number of sample having interger number of cicles in the window considered will avoid spectral leakage, after the number of sample cover a complete period you will have two peaks representing the delta function which is the fourier transform of sin.

Dividing by n come from the definition of DFT, take a look at the Matlab help for FFT function. Also refer to books such as Signals and Systems Haykin Van Veen or Signals and Systems Allan Oppenheim
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top