Skip to content

Commit

Permalink
refactor and add new default set
Browse files Browse the repository at this point in the history
  • Loading branch information
bazjo committed Aug 21, 2023
1 parent c0bc759 commit 77f8a11
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# intermodulation_calc
python script to calculate the frequencies critical to intermodulation on a given frequency set
# Intermodulation Calculation
This script calculates the critical intermodulation frequencies in a given list of frequencies. See [this page](https://www.shure.com/en-US/performance-production/louder/all-about-wireless-intermodulation-distortion) for a good introduction on the topic

The default list is not particularly well optimized.

Whoever adds the capability to calculate a frequency set as intermodulation free as possible with given start and stop frequency, minimum spacing and number of frequencies is eligible for one (1) cookie, which can be picked up at my office.
25 changes: 5 additions & 20 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
# https://www.shure.com/en-US/performance-production/louder/all-about-wireless-intermodulation-distortion
import itertools

#frequencies = [400.01, 400.13, 400.25, 400.37, 400.49, 400.63, 400.75, 400.89]
# frequencies = [400.36, 400.48, 400.63, 400.75, 400.89]
#frequencies = [400.5, 401.0, 401.5]
# frequencies = [400.48, 400.63]

# rogue sondes were on 400.63 and 400.49

# first start was on 400.01, 400.13 and 400.25

# was 400.37 already in the air?

#400.69 400.81

#frequencies = [400.01, 400.05, 400.21, 400.25, 400.57, 400.77, 405.29, 405.67, 404.01, 401.73, 404.95, 401.39]
#frequencies = [400.03, 400.11, 400.23, 400.31, 400.67, 400.97, 405.29, 405.67]
# Some fundamental explanation can be found at
# https://www.shure.com/en-US/performance-production/louder/all-about-wireless-intermodulation-distortion

frequencies = [400.250, 400.625, 401.00, 401.375, 401.75, 402.125, 402.5, 402.875, 403.25, 403.625, 404.0, 404.375, 404.75, 405.125, 405.5, 405.875]
frequencies = [400.11, 400.67, 401.09, 401.27, 401.67, 402.11, 402.49, 402.81, 403.17, 403.61, 403.99, 404.27, 404.61, 405.03, 405.31, 405.91]


threshold = 0.035
threshold = 0.035 # minimum deviation to an intermodulation product needs to be 35 kHz

class IMProduct:
def __init__(self, freq, parents, type):
Expand All @@ -41,8 +27,7 @@ def __repr__(self):
for combination in combinations:
f1 = combination[0]
f2 = combination[1]
#im3.append(round(2 * f1 - f2, 3))
#im3.append(round(2 * f2 - f1, 3))

im.append(IMProduct(round(2 * f1 - f2, 3), [f1, f2], 'IM3'))
im.append(IMProduct(round(2 * f2 - f1, 3), [f1, f2], 'IM3'))
im.append(IMProduct(round(3 * f1 - 2 * f2, 3), [f1, f2], 'IM5'))
Expand Down

0 comments on commit 77f8a11

Please sign in to comment.