A Matlab Interface to Acquire and Analyse Beam Spectra Using a Large - - PowerPoint PPT Presentation

a matlab interface to acquire and analyse beam spectra
SMART_READER_LITE
LIVE PREVIEW

A Matlab Interface to Acquire and Analyse Beam Spectra Using a Large - - PowerPoint PPT Presentation

A Matlab Interface to Acquire and Analyse Beam Spectra Using a Large Memory Digitizer A. V alimaa CERN August 27, 2014 1 / 21 Let Me Present Myself WHO Alpo V alimaa FROM Finland, Aalto University STUDYING Engineering Physics and


slide-1
SLIDE 1

A Matlab Interface to Acquire and Analyse Beam Spectra Using a Large Memory Digitizer

  • A. V¨

alimaa

CERN

August 27, 2014

1 / 21

slide-2
SLIDE 2

Let Me Present Myself

WHO

Alpo V¨ alimaa

FROM

Finland, Aalto University

STUDYING

Engineering Physics and Mathematics

HERE FOR

CERN Summer Student Program June 16 - August 29, 2014

2 / 21

slide-3
SLIDE 3

The Idea Behind

For Operations Research there exists a system (OASIS) which satisfies the users. For MD, there is potential for a flexible data acquisition tool that can provide more information than it is needed to Operate at known parameter region, to have a better view when trying new things. The idea was to develop a user interface for digitizer to gain w.r.t. some specs if compared to the oscilloscope in use and to have an environment where to start data post-processing.

3 / 21

slide-4
SLIDE 4

Data Acquisition Tool

What? A digitizer by SP Devices Model ADQ214 Quality 14-bit Memory 64 MSamples Sampling frequency 800/n MHz, n=2,3,4,...,20 Flexibility Great Resolution At 400 MHz one achieves a frequency resolution of 1 kHz for an event lasting 1 ms. More Info Here

4 / 21

slide-5
SLIDE 5

Sampling Frequency vs Recording Time

200 400 600 800 1000 1200 1400 1600 1800 50 100 150 200 250 300 350 400 450 Recording Time [ms] Sampling Frequency [MHz] ADQ214

With ADQ214 we are fully covering the basic cycle length in PS which is 1.2 seconds.

5 / 21

slide-6
SLIDE 6

Data Acquisition Tool

One can think of ADQ214 digitizer being a camera with 64

  • megapixels. A camera producing such images for which exposure

time can be changed afterwards.

6 / 21

slide-7
SLIDE 7

Oscilloscope vs Digitizer

Device Tektronix MDO4054-3 Strength All-in-one package More tools than necessary for

  • ur purpose

Device SPD ADQ214 Strength High-quality, fast rate and large memory Requires application development

7 / 21

slide-8
SLIDE 8

Oscilloscope vs Digitizer

Quality 12-bit Memory 4 ch x 20 MS Analog BW 500 MHz Signal processing Analog Spectrogram No Quality 14-bit Memory 2 ch x 64 MS Analog BW 850 MHz Signal processing After digitization with computer Spectrogram Interface for it now developed

8 / 21

slide-9
SLIDE 9

Oscilloscope vs Digitizer

Upgradability Buy a new one Price More Upgradability Upgrade device, computer or modify code. Price Less

9 / 21

slide-10
SLIDE 10

Matlab Interface - GUI

GUI Controlled by Matlab class. Consists of a spectrogram view, slider widget and file open button. View 512 x 1024 ≈ half MP. Use click+ctrl and click+shift to zoom in and out. Adjust spectrogram parameters to the view. Slider Use slider to balance with time and frequency resolutions.

10 / 21

slide-11
SLIDE 11

The Code (more in the appendix)

classdef myClass < matlab.System properties gui h % GUI handle structure in % Input data structure

  • ut

% Output data structure layerNumber % This indicates of the layer layer % Use this to navigate checkTimer % Timer object end properties (Logical) debug=false; end methods %--------Main functions--------------- end %Methods(Static) end %Classdef

11 / 21

slide-12
SLIDE 12

nToF Cycle Spectrum

Time[ms] Frequency[MHz] 200 400 10 20 30 40

Σ signal. Whole cycle shown from injection to extraction. Note constant betatron frequency but varying content of high frequencies during cycle.

12 / 21

slide-13
SLIDE 13

nToF Cycle Spectrum

Time[ms] Frequency[MHz] Overview of TOF Cycle as Seen in H Signal. RF Clock. 200 400 600 10 20 30 40

Corresponding spectrogram of nToF cycle but now with H signal.

13 / 21

slide-14
SLIDE 14

nToF Cycle Spectrum (zooming)

Time[ms] Frequency[MHz] Fluctuation of High Frequency Content at Injection. Sum Signal of TOF Beam. RF Clock. 19 20 10 20 30

Fluctuation of high frequency content can be seen during the first ms after injection. It implies oscillation of bunch size.

14 / 21

slide-15
SLIDE 15

nToF Cycle Spectrum

Time[ms] Frequency[MHz] Fluctuation of High Frequency Content After Transition. H Signal of TOF Beam. RF Clock. 152 154 156 158 160 162 10 20 30 40

Transition is a critical point in the cycle regarding beam losses. This was seen also in H signal as sudden rise of highest frequencies.

15 / 21

slide-16
SLIDE 16

nToF Cycle Spectrum

Extraction

Time[ms] Frequency[MHz] Bunch Compression Before Extraction. Sum Signal of TOF Beam. RF Clock. 562 564 566 568 10 20 30 40

For nToF cycle we see the so-called sharp extraction. The whole beam is extracted at once.

16 / 21

slide-17
SLIDE 17

Peak Detection

Time[ms] Frequency[MHz] 200 400 0.2 0.4 0.6 0.8 1

We had an algorithm to find the nearest significant peak (nearest in the frequency domain).

17 / 21

slide-18
SLIDE 18

Peak Detection

Time[ms] Frequency[MHz] 200 400 0.2 0.4 0.6 0.8 1

We developed it further to follow a curve.

18 / 21

slide-19
SLIDE 19

Peak Detection

Time[ms] Frequency[MHz] 200 400 2 4 6 8

One can use it f.ex. to extract information of the synchrotron frequency.

19 / 21

slide-20
SLIDE 20

Gating

Number of Turns Time (ns) 100 200 300 400 500 600 700 800 1000 2000 3000 4000 5000

With external clock we lose the information of time but we can record the beam position w.r.t. RF clock and gating is possible.

20 / 21

slide-21
SLIDE 21

Conclusions

In this presentation I reported the work done during my summer studentship at CERN.

◮ I developed a Matlab class and a Matlab GUI for a fast and

easy post-processing of the data acquired with the ADQ214

◮ I show few examples using the Σ and H signal of the nToF

cycle:i one single data measurement the “64 MP” image can deliver a lot of information and a give almost a complete

  • verview of the beam passage in the cycle

◮ To spot something more local, one can use the gating.

21 / 21

slide-22
SLIDE 22

Conclusions

In this presentation I reported the work done during my summer studentship at CERN.

◮ I developed a Matlab class and a Matlab GUI for a fast and

easy post-processing of the data acquired with the ADQ214

◮ I show few examples using the Σ and H signal of the nToF

cycle:i one single data measurement the “64 MP” image can deliver a lot of information and a give almost a complete

  • verview of the beam passage in the cycle

◮ To spot something more local, one can use the gating.

Thank you!

21 / 21

slide-23
SLIDE 23

The Code I

classdef myClass< matlab.System properties gui h % GUI handle structure in % Input data structure

  • ut

% Output data structure layerNumber % This indicates of the current ... layer layer % Use this to navigate through ... different zoom layers checkTimer % Timer object end properties (Logical) debug=false; end methods %--------Main ... functions---------------------------------------------------- %Class and GUI

22 / 21

slide-24
SLIDE 24

The Code II

function obj = myClass(varargin) function createGui(obj,varargin) function initializeMyClass(obj) function delete(obj) function switchChannel(obj) function closeFigureFcn(obj,varargin) %Data Processing function ... [nfft,noverlap,nWindows]=giveParametersForFFT(obj,method) function mySpectro(obj,varargin) function myMatrix=addWindow(¬,myMatrix,varargin) function plotSpectro(obj,hAxes) %Image function updateGraph(obj,hAxes) function updateLabels(obj,¬,callerFcn) function ... [h,ds data]=dsimagesc(¬,data,hAxes,method)

23 / 21

slide-25
SLIDE 25

The Code III

%Zoom function computationalZoom(obj) function select pts callback(obj,¬,¬) function zoom in callback(obj,¬,¬) function zoom out callback(obj,¬,¬) function calculate callback(obj,¬,¬) function view callback(obj) function axesButtonDownFcn(obj,hObj,¬) function ZoomInCallback(obj,¬,event) function showRegion(obj,fCenter,fWidth,t0,tend) %Peaks function ... [locMatrix,locMatric i]=findHarmonics(obj) function ... [line,line i,ind]=findNearestLine(obj,varargin) function ... [line,line i]=loopAlongTheLine(obj,method,startingP function [peak,peak i]=getNearbyPeak(¬,data)

24 / 21

slide-26
SLIDE 26

The Code IV

function ... [peak,peak i]=enhancedPeakPrecision(obj,peak i,valu function ... [loc,loc i,amplitude]=findNearestPeak(obj,varargin) function ... [peaks,peaks i]=findPeaks(¬,type,value,varargin) function ind=findNextBunch(obj,i0) %Slider function updateSliderValue(obj) function slider callback(obj,hObj,¬) function ... [smin,smax]=EvaluateSliderValueRange(obj) %Gate function ... getBaseFreqAtBunch(obj,baseFreq i,baseFreq,nBunch) function ... gateMatrix=gateSignal(obj,nTurns,clockType,varargin) function loopGatedSignal(obj,gateMatrix)

25 / 21

slide-27
SLIDE 27

The Code V

function plotTransition(obj) function plotInjection(obj) function plotExtraction(obj) %Slices - amplitude plots function ... [timeMatrix,freqMatrix,nfft,nWindows,times,freqs,accuracy]=constructSlices(obj) function plotSlices(obj,varargin) function ... varargout=amplitudePlot(obj,type,value,nfft,nWindows,strTitle) %Event Handling function ... listenToExtTrigger(obj,myDevice,timePeriod) function listenToSwTrigger(obj,myDevice) function listenToDataSavings(obj,myDevice) function respondToTriggered(obj,src,¬) function respondToDataSaving(obj,myDevice,¬) %File Handling

26 / 21

slide-28
SLIDE 28

The Code VI

function reLoad(obj) function LoadMostRecent(obj) function LoadFile Callback(obj,¬,¬) function saveData(obj,myDevice) function figureName=saveFig(obj,varargin) function openInMyClass(obj,myDev) %--------Short ... functions--------------------------------------------------- %Position function ... [coord,str,varargout]=position2Coordinates(obj,pos,varargin) function ... value i=coordinate2Position(obj,varargin) function value=getCurrentCoordinate(obj) function value i=getCurrentPosition(obj) function [iLower,iUpper]=getCurrentIndex(obj) %Notation

27 / 21

slide-29
SLIDE 29

The Code VII

function ... [str,exponent value,preval]=value2ScientificNotation( function ... str=getValuePlusMinusAccuracy(obj,value,type,accuracy) %Indexes function index=lim2ind(¬,limit) function limit=ind2lim(¬,limit) %Marks function MarkPosition(obj,position,varargin) function ClearMarks(obj) %Constrain function [x0, xend, ... shifted]=shiftPositionNearEdges(obj,x0,xend) function rect=constrainRect(obj,rect,varargin) function ... TF=isWithinLimits(¬,hAxes,point,varargin)

28 / 21

slide-30
SLIDE 30

The Code VIII

%Get Value function [nfft,nWindows]=getNFFT(obj,N data) function fNumber=getFNumber(obj) function mySignal=getSignal(obj,type) %Test function testConsistency(obj) function testMyClass(obj) %View function cleanView(obj) function normalView(obj) %Image Colors function fadeColors(obj) function returnColors(obj) function brighten(obj) function darken(obj) %Other

29 / 21

slide-31
SLIDE 31

The Code IX

function printDebug(obj,str) function stopTimer(obj,varargin) end methods(Static) function a = example() function ... [tickLabels,tickPlaces,counter]=FindMyTicks4(physicalLimits,indexLimits,exponentValue) function myCompress(data) function myCompress16(data,smallest increment) function S=myCompress8(data) function data=unCompress8(S) function ... [offset,varargout]=calibrate(signal,type,varargin) end %Methods(Static) end %Classdef

30 / 21