<commit_before># SOFiA example 1: Ideal unity plane wave simulation
# Additionally requires vispy, see http://vispy.org

import numpy as np
from sofia import gen, plot

pi = np.pi
N = 9        # Order
Nrf = N      # Radial filter order
Nviz = N     # Visualization order
krViz = 30   # Select kr bin for vizualisation

r = 0.5      # Array radius
ac = 2       # Array configuration, 2: Rigid sphere array
FS = 48000   # Sampling Frequency
NFFT = 128   # FFT-Bins
AZ = pi / 3  # Azimuth angle
EL = pi / 3  # Elevation angle

# Generate an ideal plane wave using W/G/C (Wave Generator Core)
Pnm, kr = gen.wgc(N, r, ac, FS, NFFT, AZ, EL)

# Make radial filters for the rigid sphere array
dn, _ = gen.mf(Nrf, kr, ac)

# Generate visualization data
vizMTX = plot.makeMTX(Pnm, dn, Nviz, krViz)

# Visualize
#plot.visualize3D(vizMTX, style='sphere')<commit_msg>add additional info on exporting png<commit_after># SOFiA example 1: Ideal unity plane wave simulation
# Additionally requires vispy, see http://vispy.org

import numpy as np
from sofia import gen, plot

pi = np.pi
N = 9        # Order
Nrf = N      # Radial filter order
Nviz = N     # Visualization order
krViz = 30   # Select kr bin for vizualisation

r = 0.5      # Array radius
ac = 2       # Array configuration, 2: Rigid sphere array
FS = 48000   # Sampling Frequency
NFFT = 128   # FFT-Bins
AZ = pi / 3  # Azimuth angle
EL = pi / 3  # Elevation angle

# Generate an ideal plane wave using W/G/C (Wave Generator Core)
Pnm, kr = gen.wgc(N, r, ac, FS, NFFT, AZ, EL)

# Make radial filters for the rigid sphere array
dn, _ = gen.mf(Nrf, kr, ac)

# Generate visualization data
vizMTX = plot.makeMTX(Pnm, dn, Nviz, krViz)

# Visualize
canvas = plot.visualize3D(vizMTX, style='cshape')

# To export to png:
# >> from vispy import io
# >> img = canvas.render()
# >> io.write_png("AE1_render.png", img)
{'fraction_non_alphanumeric': 0.09924487594390508, 'fraction_numerical': 0.021035598705501618, 'mean_word_length': 3.2545871559633026, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3178549', 'n_tokens_mistral': 711, 'n_tokens_neox': 653, 'n_words': 247}