cdma matlab code
I did that. Maybe im still confuse about some stuff regarding the FFT.
Therefore, let me go to the basics on how FFT works first before proceding. I generated a simple example here to describe my confusion.
Figure1 here is a periodic sine wave at a interval of 0.63s. Figure2 is the FFT of the sinewave in Figure1.
What i dont understand here is after performing FFT on the periodic sinewave in Figure1, the signal gets converted to 126 Hz in Figure2 (assuming to be Hertz since FFT was performed). Based on Figure1, the sinewave interval is 0.63s. Converting it to frequency domain should be F= 1/T =1/0.63= 1.58Hz. Thus, how did the signal appeared at 126Hz in Figure2 instead? Furthermore, the amplitude in Figure1 is 1. Figure2 amplitude increased to 60+ as well. Since the amplitude in the time domain is equal to 1, shouldn't the amplitude in the frequency domain be 1 as well?
Can anyone please help me out in this? Really really confuse here.
This is the matlab coding i used.
y=-2*pi:0.1:2*pi
t=0.01:0.01:1.26
x =sin (y .* t .* (1./t));
figure,plot(t,x);
title('Figure1');
figure,plot(abs(fft(x)));
title('Figure2')