Amplitude Look-Up Table (LUT) Support for Waveform Processing#1696
Open
bennthomsen wants to merge 6 commits intoQCoDeS:mainfrom
Open
Amplitude Look-Up Table (LUT) Support for Waveform Processing#1696bennthomsen wants to merge 6 commits intoQCoDeS:mainfrom
bennthomsen wants to merge 6 commits intoQCoDeS:mainfrom
Conversation
astafan8
approved these changes
Feb 3, 2026
| return signal_filtered | ||
|
|
||
|
|
||
| def applyAmplitudeLUT(signal, lut): |
Contributor
There was a problem hiding this comment.
pelase use type annotations. And lut argument is not a numpy array, it's a dictionary with keys LUT_input and LUT_output, right? then you can annotate it so using e.g. TypedDict
| Args: | ||
| signal (np.array): The input signal. The signal is assumed to have | ||
| values in the range [-1, 1]. | ||
| lut (np.array): The amplitude LUT. Should be a 1D array of length N, |
Contributor
There was a problem hiding this comment.
lut is a dictionary, if i look at the code, right?
| for pos in range(1, seqlen + 1): | ||
| if "flags" in elements[pos - 1][chan]: | ||
| flags = elements[pos - 1][chan]["flags"].tolist() | ||
| flags = elements[pos - 1][chan]["flags"] |
Contributor
There was a problem hiding this comment.
why was this change needed?
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1696 +/- ##
==========================================
+ Coverage 72.12% 72.35% +0.23%
==========================================
Files 9 9
Lines 1539 1552 +13
==========================================
+ Hits 1110 1123 +13
Misses 429 429 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary: Add Amplitude Look-Up Table (LUT) Support for Waveform Processing
Description
This PR adds amplitude look-up table (LUT) functionality to broadbean, enabling users to apply non-linear amplitude transformations to waveforms during sequence output generation. This is useful for compensating for DAC non-linearities or implementing custom amplitude mappings on AWG channels.
Changes
New Features
setAmplitudeLUT(channel, lut_input, lut_output)- New method onSequenceclass to define an amplitude LUT for a specific channel. The LUT is applied after all other waveform processing (including RC filter compensation).applyAmplitudeLUT(signal, lut)- New function inripasso.pythat applies the LUT using numpy interpolation.Files Changed
src/broadbean/sequence.pysetAmplitudeLUTmethod and LUT application inforge()and_prepareForOutputting()methodssrc/broadbean/ripasso.pyapplyAmplitudeLUTfunctiontests/test_sequence.pydocs/examples/Amplitude_LUT_Example.ipynbdocs/examples/index.rst.gitignoreUsage Example
Testing
Three test cases added:
test_setAmplitudeLUT- Basic LUT functionality and storagetest_setAmplitudeLUT_multiple_channels- LUT with multiple independent channelstest_setAmplitudeLUT_no_lut- Ensures backward compatibility when no LUT is setAdditional Notes
numpy.interpfor efficient interpolation.tolist()call on flags inoutputForSEQXFileWould you like me to adjust this summary or add any additional information?