I'm trying to generate a custom signal but I'm viewing something wrong so I wrote a test derived from generate* C examples.
You can find the test code is below but you can see from my osc that the signal has problems on (frame) transition.
Do you have any clue?
Tnx
pz
https://filebin.net/18770juehipgrns2/Sq ... t=hwo3bfb0
https://filebin.net/18770juehipgrns2/Sq ... t=hwo3bfb0
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "redpitaya/rp.h"
int main(int argc, char **argv){
int i;
int buff_size = 16384;
int sig_size = 1488;
/* Print error, if rp_Init() function failed */
if(rp_Init() != RP_OK){
fprintf(stderr, "Rp api init failed!\n");
}
float *x = (float *)malloc(buff_size * sizeof(float));
for (i = 0; i < sig_size/2; ++i){
x[i] = 1.0;
}
for (; i < sig_size; ++i){
x[i] = -0.5;
}
rp_GenWaveform(RP_CH_1, RP_WAVEFORM_ARBITRARY);
rp_GenArbWaveform(RP_CH_1, x, sig_size);
rp_GenAmp(RP_CH_1, 1.0);
rp_GenFreq(RP_CH_1, 4000.0);
rp_GenOutEnable(RP_CH_1);
/* Releasing resources */
free(x);
rp_Release();
}