+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Newbie level 4
    Points: 50, Level: 1

    Join Date
    Nov 2019
    Posts
    5
    Helped
    0 / 0
    Points
    50
    Level
    1

    How to perform FFT on random data signal correctly in MATLAB?

    Hello,
    I am a student doing research in high-speed electrical link.

    I have came up with a new signaling scheme, and want to see spectrum plot of it but not sure how to correctly perform fft on the signal in MATLAB.
    My signaling scheme, uses phase modulation to have same spectral efficiency as PAM-4 signal (which is 2bits/UI) but has one-UI that is 1.25 times larger than the PAM-4 signaling.
    We know that for PAM-4 signaling, the first null in the spectrum plot appears at its symbol-rate. Therefore, for the signaling scheme that I am proposing, I am expecting to see the first null at 1/1.25 = 0.8*symbol-rate of PAM-4. However, this is not the result that I am seeing through FFT.

    I think I have followed all the fft rules (sampling-rate >> symbol-rate, including integer # of cycles) but not sure what is wrong..
    Could anyone please help me on this?

    Below is my code for fft.

    Code - [expand]
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    
    % sampling-rate is chosen Rs times the symbol-rate of the signal.
    fs = f_sym*Rs; Ts = 1/fs;
    % warning if symbol period is smaller than the sampling interval
     
    if (fs < f_sym)
    error('symbol period is smaller than the sampling interval');
    end
     
    % fft
    N = size(signal, 2);
    signal_fft = (fftshift(fft(signal, N)))/(N/2);
    signal_fft_abs = abs(signal_fft);
    signal_fft_db = db(signal_fft_abs);
    df = fs/N;
    f = -fs/2:df:fs/2-df;
     
    % plot the result
    figure;
    plot(f(end/2+1:end), db(signal_fft_abs(end/2+1:end)), linestyle);

    The result shows correct plot for PAM-4. I have used PAM-4 signal with symbol-rate of 1Gsymbol/s. Then, I see in the spectrum plot that there is null at multiples of 1GHz.
    Click image for larger version. 

Name:	PAM_fft.png 
Views:	15 
Size:	57.7 KB 
ID:	156344

    However, for the signaling scheme that I came up with, I see null at 4GHz even if its maximum symbol-rate is 0.8Gsymbol/s. Why, I am not seeing a clear null at 800MHz?
    Click image for larger version. 

Name:	PAM_PM_FFT.png 
Views:	7 
Size:	52.1 KB 
ID:	156343
    Last edited by bassa; 4th November 2019 at 09:49. Reason: add code syntax

    •   AltAdvertisement

        
       

  2. #2
    Super Moderator
    Points: 79,246, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,081
    Helped
    3643 / 3643
    Points
    79,246
    Level
    68

    Re: How to perform FFT on random data signal correctly in MATLAB?

    Hi,

    I think I have followed all the fft rules (sampling-rate >> symbol-rate, including integer # of cycles) but not sure what is wrong..
    Better give all the really used values than vague informations.

    Can you post a picture of your FFT signal input (time domain)

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisement

        
       

  3. #3
    Newbie level 4
    Points: 50, Level: 1

    Join Date
    Nov 2019
    Posts
    5
    Helped
    0 / 0
    Points
    50
    Level
    1

    Re: How to perform FFT on random data signal correctly in MATLAB?

    Hello KlausST,

    Thank you for your reply.
    For the following spectrum result that I posted before, I am using the following values.

    For PAM-4,
    symbol-rate is 1Gsym/s (f_sym = 1e9) so one symbol period is 1ns.
    Sampling-rate is 1000GHz (Rs = 1000).

    This is the time-domain of PAM-4 signal that I am using as one period in n-point dft.
    It contains 100 symbols, and in each symbol there are 1000 samples of points, so total 100000 points in the dft.
    Attachment 156359

    For the signaling scheme that I am proposing, it uses PAM-4 signaling and PM-4 in an alternate way as below.
    In this case, symbol-rate in PAM-4 UI is 1Gsym/s. In PM-4 UI, PM spacing is 0.25UI.
    Therefore, minimum pulse-width of 1.25UI can be achieved.
    Click image for larger version. 

Name:	PAM_PM_concept.png 
Views:	3 
Size:	5.1 KB 
ID:	156360

    symbol-rate is set to 1Gsym/s (f_sym = 1e9) so minimum pulsewidth is 1.25ns in this case.
    Sampling-rate is 1000GHz (Rs = 1000).

    This is the time-domain of the signal that I am using as one period in n-point dft.
    It contains 100 symbols of PAM-4 and PM-4 each (so in total 200 symbols).
    In each PAM-4 symbol, there are 1000 samples of points.
    In each PM-4, each PM slice in time (0.25UI) contains 250 samples of points.
    Attachment 156358


    Thank you.



    •   AltAdvertisement

        
       

  4. #4
    Super Moderator
    Points: 79,246, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,081
    Helped
    3643 / 3643
    Points
    79,246
    Level
    68

    Re: How to perform FFT on random data signal correctly in MATLAB?

    Hi,

    Before you talked about FFT. There the window size should be 2^n samples (n = integer).

    Now you talk about DFT. Why?
    DFT window size should be an integer value.

    Independent of DFT or FFT...you should imagine that the input windows (with same content) are placed one after the other (= signal is repeating). Now check that there is no mismatch at the edges of the window.

    If you can't ensure this ... you need to perform a "windowing function" (Hamming, von Hann ...) before you perform the fourier function.

    For an FFT: if possible use Rs = 512 or Rs = 1024 (instead of 1000). Check if this gives a benefit.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



--[[ ]]--