intermod_library package¶
Submodules¶
intermod_library.intermod_library module¶
Intermod Tools
@author: William Boxx
- intermod_library.intermod_library.harmonic_toi(frqs, order, band_of_interest=[])[source]¶
Calculates the harmonic table of interest for given frequencies.
Will calculate the harmonics of the given frequencies and highlight which ones fall within the given band of interest.
- Parameters:
frqs (float) – list of frequencies
order (integer) – largest order of harmonic
band_of_interest (tuple(float)) – tuple containing the lower and upper values of the band of interest
- Returns:
pandas dataframe that lists harmonics and emphasizes those in boi with **
- Example:
>>> import intermod_library.intermod_library as il >>> frqs = [1000] >>> order = 5 >>> band_of_interest = [2500, 3500] >>> table = il.harmonic_toi(frqs, order, band_of_interest) >>> table
<index>
Signal 1
Harmonic #1
1000.0
Harmonic #2
2000.0
Harmonic #3
**3000.0
Harmonic #4
4000.0
Harmonic #5
5000.0
- intermod_library.intermod_library.intermod_locate(soi, pivot, order)[source]¶
Calculates a list of frequencies that would create an intermod at soi.
Will calculate a list of frequencies that could combine with the pivot to create intermods at the signal of interest (soi).
- Parameters:
soi (float) – signal of interest
pivot (float) – pivot frequency
order (integer) – largest order of harmonic
- Returns:
pandas dataframe that lists possible frequencies and order
- Example:
>>> import intermod_library.intermod_library as il >>> soi = 2227.75 >>> pivot = 2196.0 >>> order = 3 >>> table = il.intermod_locate(soi, pivot, order) >>> table
<index>
Frequency
Signal 1
Signal 2
Order
0
15.875
1.0
2.0
3.0
1
31.750
1.0
1.0
2.0
2
742.583
0.0
3.0
3.0
3
1113.875
0.0
2.0
2.0
4
2164.250
2.0
-1.0
3.0
- intermod_library.intermod_library.intermod_table(signals, order, lower_limit, upper_limit, maximum_single_order=None, bandwidths=None)[source]¶
Calculates intermodulation products between the given signals
Will calculate all intermodulation products that could be potentially created between the given signals. Must specify the highest order of intermods.
- Parameters:
signals (list[float]) – list of signals to calculate intermod products on
order (integer) – highest order of intermod products to calculate
lower_limit (integer) – lower frequency limit in MHz to filter intemod list above
upper_limit (integer) – upper frequency limit in MHz to filter intemod list below
maximum_single_order (integer) – the maximum order for a single frequency
bandwidths (list[float]) – bandwidths of the provided signals.
- Returns:
tuple of lists (freqs, tx_indexes, coeff_tuples, order_tuples)
- Example:
>>> import intermod_library.intermod_library as il >>> signals = [1000, 2000] >>> order = 3 >>> freqs, tx_indexes, coeff_tuples, order_tuples = il.intermod_table(signals, order, lower_limit=0, upper_limit=100e3) >>> table = ( pl.DataFrame( { "frequency": freqs, "coefficients": coeff_tuples, "tx_indexes": tx_indexes, "intermod_order": order_tuples } ) .lazy() .unique( subset=["frequency", "tx_indexes", "coefficients"] ) .sort( by=["frequency", "intermod_order"] ) ) >>> table.collect()
frequency
coefficients
tx_indexes
intermod_order
1000.0
(-1, 1)
(0, 1)
2
3000.0
(1, 1)
(0, 1)
2
3000.0
(-1, 2)
(0, 1)
3
4000.0
(2, 1)
(0, 1)
3
5000.0
(1, 2)
(0, 1)
3
Module contents¶
Top-level package for intermod-library.