Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to scale rfIQ data to match setup_notches response data. #761

Open
swh76 opened this issue Mar 18, 2023 · 0 comments
Open

Add option to scale rfIQ data to match setup_notches response data. #761

swh76 opened this issue Mar 18, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@swh76
Copy link
Collaborator

swh76 commented Mar 18, 2023

Describe the problem

Apparently rfIQ data taken like this ;

nsamp=2**23
i,q,sync = S.take_debug_data(band=0,channel=0,rf_iq=True, nsamp=nsamp)

has a different I/Q convention than the response data returned by setup_notches. This is confusing and annoying. We should add an option to take_debug_data to scale the returned rfIQ data to match the setup_notches convention so folks don't have to know/think about this.

I worked out the difference by taking fixed tone rfIQ data at the same set of frequencies as a setup_notches sweep like this;

power=12
nsamp=2**23

ii=[]
qq=[]
ss=[]
for f in S.freq_resp[0]['resonances'][0]['freq_eta_scan'][::4]:
    band,chan=S.set_fixed_tone(f,power)
    
    i,q,sync = S.take_debug_data(band=band,channel=chan,rf_iq=True, nsamp=nsamp)
    ii.append(i)
    qq.append(q)
    
    S.channel_off(band,chan)

qmean=[np.mean(qqq) for qqq in qq]
imean=[np.mean(iii) for iii in ii]

For a superconducting resonator in the SLAC cryostat chosen at random, I can convert the setup_notches data to the rfIQ data using this transformation:

plt.plot(imean,qmean,label='rfIQ')
plt.plot(1.2*np.real(S.freq_resp[0]['resonances'][0]['resp_eta_scan'][::4]),-1.2*np.imag(S.freq_resp[0]['resonances'][0]['resp_eta_scan']),label='setup_notches')
plt.legend()
plt.axes().set_aspect('equal')

so if you take rfIQ data like this:

i,q,sync = S.take_debug_data(band=0,channel=0,rf_iq=True, nsamp=nsamp)

you can scale setup_notches data into it like this

1.2*np.real(S.freq_resp[0]['resonances'][0]['resp_eta_scan']),-1.2*np.imag(S.freq_resp[0]['resonances'][0]['resp_eta_scan']

the 1.2 is almost certainly the PFB subband half width, 1.2 MHz.

@swh76 swh76 added the enhancement New feature or request label Mar 18, 2023
@swh76 swh76 self-assigned this Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant