• Aucun résultat trouvé

1 Connecting to the Redpitaya

N/A
N/A
Protected

Academic year: 2022

Partager "1 Connecting to the Redpitaya"

Copied!
2
0
0

Texte intégral

(1)

Redpitaya ADC characterization

, January 18, 2021

1 Connecting to the Redpitaya

The ssh serverdropbearis currently not functional on the Redpitaya, so thatsshandscpcannotbe used ! Please connect to the Redpitaya withminicomand transfer files through NFS as the home directory on the host computer can be exported to the Redpitaya.

2 Data acquisition

Two bitstreams are provided,adcChanADmaDirect single.bit.binandadcChanADmaDirect dual.bit.binfor single chan- nel measurement or dual channel synchronous measurements. The devicetree overlay requires that the bitstream is called adcChanADmaDirect wrapper.bit.binso rename (cp) the wanted bitstream accordingly.

Launch onceadcChanADmaDirect us.shto initialize the Redpitaya, namely by loading the kernel moduledata dma direct core.ko, copying the bitstream to the right location in the GNU/Linux tree structure, and loading the bitstream in the FPGA. All

these steps are automated thanks to theadcChanADmaDirect.dtbodevicetree overlay.

Once the Redpitaya has been initialized, the application adcChanADmaDirect uswill acquire data through the DMA, 1 Msamples for a single channel or 500 ksamples/channel interleaved for two channels. The output filename isdump.bin, to be copied to the host PC through NFS.

3 Data processing

The data are stored in binary format, signed 16-bit integers. With GNU/Octave: for a single channel acquisition

f=f o p e n(’ d u m p . bin ’) ; d=f r e a d( f ,’ i n t 1 6 ’) ; f=l i n s p a c e(1 2 5 / 2 , 1 2 5 / 2 ,l e n g t h( d ) ) ; p l o t( f ,a b s(f f t s h i f t(f f t( dmean( d ) ) ) ) )

and for a dual channel acquisition

f=f o p e n(’ d u m p . bin ’) ; d=f r e a d( f ,’ i n t 1 6 ’) ; d1=d ( 1 : 2 :end) ;

d2=d ( 2 : 2 :end) ;

f=l i n s p a c e(1 2 5 / 2 , 1 2 5 / 2 ,l e n g t h( d1 ) ) ; p l o t( f ,a b s(f f t s h i f t(f f t( d1mean( d1 ) ) ) ) )

4 Time v.s frequency

Energy must be conserved, whether data are displayed in the time domain or the frequency domain (Parseval theorem analyzed from its energy conservation perspective by Rayleigh). Indeed, as found in Lord Rayleigh, On the character of the complete radiation at a given temperature, The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science27(169), 460–469 (1889),

...

The energy of the signal in the time domain in P

x2k computed in GNU/Octave assum(x.^2)

The challenge in the frequency domain lies in properly normalizing the spectra. Many presentations on the web explain how to correctly normalize power spectra1, so we will use the readily signal processing toolpwelch2 here

1e.g. S. Hageman, Real spectrum analysis with Octave and MATLAB, EDN (2015) at https://www.edn.com/

real-spectrum-analysis-with-octave-and-matlab/

2O.M. Solomon,PSD Computations Using Welch’s Method, Sandia Report (1991) athttps://www.osti.gov/servlets/purl/5688766/

1

(2)

pkg l o a d s i g n a l N=32768;

f s =1;

x=rand(N, 1 ) ; x=xmean( x ) ; window=r e c t w i n (N) ;

% d e f a u l t i s f o r p w e l c h t o REMOVE t h e mean v a l u e [ pxx , f ]= p w e l c h ( x , window , 0 , N, f s , [ ] ,’ no - s t r i p ’) ; % W/Hz s u b p l o t( 1 2 1 ) ;p l o t( f , 1 0l o g 1 0( pxx ) ) ; y l a b e l(’ dBW / Hz ’) s u b p l o t( 1 2 2 ) ;p l o t( f , 1 0l o g 1 0( pxxf s /N) ) ; y l a b e l(’ dBW / bin ’) sum( pxx )

demonstrates that indeedsum(pxx)is equal tosum(x.^2). Notice thatpwelchis also available for SciPy asscipy.signal.pwelch For plotting histograms, hist() can be used. The excellent peakfit.m at https://terpconnect.umd.edu/~toh/

spectrum/InteractivePeakFitter.htm is used for Gaussian peak fitting. After recording the bin index and number of samples per bin, peak fitting is achieved with

pkg l o a d s i g n a l

f=f o p e n(’ d u m p . bin ’) ; d=f r e a d( f ,’ i n t 1 6 ’) ; d1=d ( 1 : 2 :end) ; d1=d1mean( d1 ) ;

d2=d ( 2 : 2 :end) ; d2=d2−mean( d2 ) ;

f=l i n s p a c e(1 2 5 / 2 , 1 2 5 / 2 ,l e n g t h( d1 ) ) ; [ hh , xx ]=h i s t( d1 ,f l o o r(max( d1 )min( d1 ) ) ) ; s i g n a l =[ xx ’ hh ’ ] ;

[ F i t R e s ,GOF, b l , c o e f f , r e s , x i , y i , BootRes ]= p e a k f i t ( s i g n a l , 0 , 0 , 1 , 1 , 0 , 0 , [ 0 max( xx ) ] , 0 , 0 , 0 ) ;

whereFitResholds the mean value and width of the peak in its second and fourth attributes respectively, and the result of the fit is in(xi,yi).

Fig. 1 displays an example of such a processing on experimental data with the ADC loaded by a 50 Ω resistor. The case of a sine wave is shown in Fig. 2

0 10000 20000 30000 40000 50000

-30 -20 -10 0 10 20 30

number of samples

bin number

mean=-0.45 width=11.1

data fit

Figure 1: Fit of the bit value distribution of the ADC loaded on a 50 Ω resistor (noise).

bin count

bin number 0

50 100 150 200

-15000 -10000 -5000 0 5000 10000 15000

hist(d(1:2:1e5),1024)

bin count

bin number 0

50 100 150 200 250 300

-1500 -1000 -500 0 500 1000 1500

hist(d(1:2:1e5),1024)

Figure 2: Histogram of an undersampled 250 MHz (left) and 850 MHz (right) sine wave sampled at 122.88 S/s with the 16-bit Redpitaya.

2

Références

Documents relatifs

Although the Revised European Social Charter (1996), the American Convention on Human Rights (1969), and the African Charter on Human and Peoples’ Rights (1981)

Committee on Economic, Social and Cultural Rights 4 The right to have regular, permanent and free access, either directly or by means of financial purchases, to

The Committee on the Elimination of Racial Discrimination, in its general recommendation N° 30 (2004) on non-citizens, and the Committee on Economic, Social and

Listen to the teacher and choose the right colours.. Listen to the teacher and choose the

of the Covenant, either in the country to which removal is to be effected or in any country to which the person may subsequently be removed.” 69 It should be noted, moreover,

Patient and doctor are partners. T he relation of doctor to patient is changing. Gradually, patients are moving from an essentially subservient position to one in which they

The services axis encompasses all levels of the health system, including health care services provided to individuals in the primary care setting, and in hospitals,

The Register pulls together information from diverse international agencies, scientific institutions, government experts and industrial contacts around the world and brings