Skip to content

Commit

Permalink
small fix to some python scripts :)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvarNilsson committed Jul 31, 2024
1 parent 7de5af0 commit f94d791
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions python_scripts/analyze_from_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from ctypes import c_int32
import os

nr_arrays = 2 # todo: make this find the nr_arrays from the header :)
nr_arrays = 1 # todo: make this find the nr_arrays from the header :)
expected_columns = nr_arrays * 64 + 2


def print_analysis(fileChooser, microphones, source_audio):
def print_analysis(fileChooser, source_audio):

def load_data_FPGA():

Expand Down Expand Up @@ -158,6 +158,5 @@ def main():
print("Enter the frequency of the audio source (Hz): ")
# source_audio=input()
source_audio = 440
microphones = [0]

print_analysis(fileChooser, microphones, source_audio)
print_analysis(fileChooser, source_audio)
2 changes: 1 addition & 1 deletion python_scripts/sound_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def Average(l):
data = np.fromfile(path, dtype=c_int32, count=-1, offset=0) # Read the whole file
# reshapes into a Numpy array which is N*68 in dimensions

nr_arrays = 2 # todo: make this find the nr_arrays from the header :)
nr_arrays = 1 # todo: make this find the nr_arrays from the header :)
expected_columns = nr_arrays * 64 + 2
data2D = data.reshape(-1, expected_columns)

Expand Down
2 changes: 1 addition & 1 deletion python_scripts/tb_fir_post_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def moving_average(data, window_size):
frequencies = np.fft.fftfreq(min_length, 1 / sample_rate)

# Select frequencies within 0-10000 Hz
max_freq = 10000
max_freq = 20000
indices = np.where((frequencies >= 0) & (frequencies <= max_freq))
selected_frequencies = frequencies[indices]

Expand Down

0 comments on commit f94d791

Please sign in to comment.