Skip to content

Commit

Permalink
Remove unused files
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Aug 22, 2024
1 parent c3696d2 commit 054a349
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 302 deletions.
Empty file removed src/python/__init__.py
Empty file.
26 changes: 0 additions & 26 deletions src/python/conda_pffdtd.yml

This file was deleted.

68 changes: 2 additions & 66 deletions src/python/pffdtd/diffusor/design.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import cv2
import numpy as np

from pffdtd.diffusor.qrd import quadratic_residue_diffuser

# fmax calculation matches multiple online calculators. Not sure about fmin
"""fmax calculation matches multiple online calculators. Not sure about fmin
"""


def diffusor_bandwidth(well_width, max_depth, c=343.0):
Expand All @@ -16,63 +12,3 @@ def diffusor_dimensions(fmin, fmax, c=343.0):
max_depth = c/(fmin*4)
well_width = c/(fmax*2)
return max_depth, well_width


def fractal_diffusor(primes, long_well, long_depth, short_depth, repeats=1, c=343.0):
long_fmin, long_fmax = diffusor_bandwidth(long_well, long_depth, c)
long_wells = quadratic_residue_diffuser(primes[0], long_depth)
print(f"long_well={long_well*100:.2f}cm")
print(f"long_depth={long_depth*100:.2f}cm")
print(f"{long_fmin=:.1f}Hz")
print(f"{long_fmax=:.1f}Hz")
print("")

short_well = long_well/primes[1]
short_fmin, short_fmax = diffusor_bandwidth(short_well, short_depth, c)
short_wells = quadratic_residue_diffuser(primes[1], short_depth)
print(f"short_well={short_well*100:.2f}cm")
print(f"short_depth={short_depth*100:.2f}cm")
print(f"{short_fmin=:.1f}Hz")
print(f"{short_fmax=:.1f}Hz")
print("")

total_depth = long_depth+short_depth
total_width = long_well*primes[0]*int(repeats)
print(f"{total_depth=:.2f}m")
print(f"{total_width=:.2f}m")

ratio = total_width/total_depth
img_width = 1000
dx = total_width/img_width
img_size = (int((img_width+50)/ratio), img_width)
print(dx)
print(img_size)

img = np.zeros(img_size, dtype=np.uint8)
for r in range(int(repeats)):
xo = int(long_well*primes[0]*r/dx)
for i in range(primes[0]):
p1 = (int(xo+i*(long_well/dx)), 0)
p2 = (int(p1[0]+long_well/dx), int(long_wells[i % primes[0]]/dx))
cv2.rectangle(img, p1, p2, (100, 100, 100), -1)
for j in range(primes[1]):
ps1 = (int(p1[0]+j*(short_well/dx)), p2[1])
ps2 = (int(ps1[0]+short_well/dx), p2[1] +
int(short_wells[j % primes[1]]/dx))
cv2.rectangle(img, ps1, ps2, (255, 255, 255), -1)

img = cv2.flip(img, 0)
cv2.imwrite('fractal.png', img.astype(np.uint8))


def main():
primes = (13, 11)
long_well = 0.12
long_depth = 0.24
short_depth = long_well*0.7
repeats = 2
fractal_diffusor(primes, long_well, long_depth, short_depth, repeats)


if __name__ == "__main__":
main()
Empty file.
71 changes: 0 additions & 71 deletions src/python/pffdtd/speaker/alignment.py

This file was deleted.

44 changes: 0 additions & 44 deletions src/python/pffdtd/speaker/crossover.py

This file was deleted.

17 changes: 0 additions & 17 deletions src/python/pffdtd/speaker/driver.csv

This file was deleted.

78 changes: 0 additions & 78 deletions src/python/pffdtd/speaker/power.py

This file was deleted.

0 comments on commit 054a349

Please sign in to comment.