This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TSW14J57EVM: Loading External Pattern File which is created using NumPy in Python

Part Number: TSW14J57EVM

Good afternoon, 

I create the frequency modulated signal in Python and save it to csv like in the image.

You can see that they are all sin signals with different frequencies.

However, when I loading it to the High Pro, sin signals are converted multiple rectangles, and amplitude is decreased as well by program.

As you can see all of them are simulated by rectangules, and amplitude is decreased from 32000 to 10.

Can you help me how I can solve this issue?

P.s: The way that I create the signal is like this

def sinusoid_generator(Amp,freq,t):
    return Amp*np.sin(2*np.pi*freq*t)

t = np.linspace(0, 1, 65536) 
saw_mod = np.array([])
for i in range(1,10):
    saw_mod = np.concatenate((saw_mod,sinusoid_generator(32000,i,t)))

  • Farid,

    One of our Python experts is looking into this. Please verify your .csv files follows these rules:

    The imported file must be text format integer value from – 2^ (Number of Bits -1) to 2^ (Number of Bits -1) –
    1 in a single column format if testing a single DAC. For dual DAC’s, the file must be in 2 columns. For quad
    DAC’s, 4 columns. The length can be from 4096 to 512M (single column) in increments of 32.

    We generated a similar program but used Matlab. See if this helps you.

    Regards,

    Jim

    Fs = 6400; %MSPS

    res = 16; %resolution in bits

    chirp_length = 2^10; %length of chirp in samples

    fstart = 500; % MHz

    fstep = 500/chirp_length; %freq step in MHz/sample

    phasevalue = zeros(1,chirp_length);

    for pindex = 2:chirp_length

        phasevalue(pindex) = phasevalue(pindex-1)+2*pi*(fstart+pindex*fstep)/Fs;

    end

    chirp =real(round(0.95*cos(phasevalue)*2^(res-1)));

  • Farid,

    We created a .csv file using your program and loaded it into HSDC Pro with no issue. See attached results. I have also attached the .csv file.

    Regards,

    Jim

    TSW14J57EVM csv file.pptxshows.csv 

  • Jim,

    Thanks a lot for quick responses and the Matlab program. It seems the problem was in NumPy. Because converting the numpy array to pandas dataset and then saving it as csv file with to_csv method worked perfectly fine in HSDC Pro instead of savetxt function of the NumPy module.

    Thanks again,

    Farid