Browse Source

ditigalFilter.py removed + small GUI changes

ein paar kleinere GUI skalierungsänderungen
master
seyffejn 4 years ago
parent
commit
6adced12b4

+ 5
- 0
.gitignore View File

@@ -4,3 +4,8 @@ TinnitusAnalyse/.idea/workspace.xml
TinnitusAnalyse/eggs.csv
TinnitusAnalyse/.idea/workspace.xml
*.xml
TinnitusAnalyse/sound.wav
*.pyc
*.xml
TinnitusAnalyse/.idea/workspace.xml
TinnitusAnalyse/__pycache__/SoundGenerator.cpython-35.pyc

+ 79
- 44
TinnitusAnalyse/.idea/workspace.xml View File

@@ -2,8 +2,12 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="5b3f2136-e422-4072-84be-e86e40fa2d55" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/DigitalFilter1.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/../.gitignore" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/DigitalFilter.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/SoundGenerator.py" beforeDir="false" afterPath="$PROJECT_DIR$/SoundGenerator.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/TinnitusAnalyse_GUI.py" beforeDir="false" afterPath="$PROJECT_DIR$/TinnitusAnalyse_GUI.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/TinnitusDaten.csv" beforeDir="false" afterPath="$PROJECT_DIR$/TinnitusDaten.csv" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
@@ -16,8 +20,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/TinnitusAnalyse_GUI.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="17">
<caret line="14" selection-start-line="14" selection-end-line="14" />
<state relative-caret-position="805">
<caret line="122" lean-forward="true" selection-start-line="122" selection-end-line="122" />
<folding>
<element signature="e#0#117#0" expanded="true" />
</folding>
@@ -34,11 +38,11 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/SoundGenerator.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="688">
<caret line="80" column="119" lean-forward="true" selection-start-line="80" selection-start-column="60" selection-end-line="80" selection-end-column="119" />
<state relative-caret-position="520">
<caret line="62" column="32" lean-forward="true" selection-start-line="62" selection-start-column="32" selection-end-line="62" selection-end-column="32" />
<folding>
<element signature="e#0#11#0" expanded="true" />
</folding>
@@ -46,22 +50,10 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/DigitalFilter1.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1782">
<caret line="81" column="28" lean-forward="true" selection-start-line="81" selection-start-column="28" selection-end-line="81" selection-end-column="28" />
<folding>
<element signature="e#0#47#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python35/Lib/site-packages/matplotlib/axes/_base.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<state relative-caret-position="3349">
<caret line="230" selection-start-line="230" selection-end-line="230" />
</state>
</provider>
@@ -99,6 +91,8 @@
<find>scale_lautstärke_links_change</find>
<find>mute</find>
<find>Sound(</find>
<find>700</find>
<find>nachname</find>
</findStrings>
<dirStrings>
<dir>C:\Users\Julian\PycharmProjects\TinnitusAnalyse</dir>
@@ -111,9 +105,11 @@
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/WriteToCSV.py" />
<option value="$PROJECT_DIR$/DigitalFilter1.py" />
<option value="$PROJECT_DIR$/Noise Experiment.py" />
<option value="$PROJECT_DIR$/DigitalFilter.py" />
<option value="$PROJECT_DIR$/SoundGenerator.py" />
<option value="$PROJECT_DIR$/TinnitusAnalyse_GUI.py" />
<option value="$PROJECT_DIR$/DigitalFilter1.py" />
</list>
</option>
</component>
@@ -153,7 +149,28 @@
</list>
</option>
</component>
<component name="RunManager" selected="Python.DigitalFilter1">
<component name="RunManager" selected="Python.TinnitusAnalyse_GUI">
<configuration name="DigitalFilter" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="TinnitusAnalyse" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/DigitalFilter.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="DigitalFilter1" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="TinnitusAnalyse" />
<option name="INTERPRETER_OPTIONS" value="" />
@@ -175,7 +192,7 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="SoundGenerator" type="PythonConfigurationType" factoryName="Python" temporary="true">
<configuration name="Noise Experiment" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="TinnitusAnalyse" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
@@ -187,7 +204,7 @@
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/SoundGenerator.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/Noise Experiment.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
@@ -196,7 +213,7 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="TinnitusAnalyse_GUI" type="PythonConfigurationType" factoryName="Python" temporary="true">
<configuration name="SoundGenerator" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="TinnitusAnalyse" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
@@ -208,7 +225,7 @@
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/TinnitusAnalyse_GUI.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/SoundGenerator.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
@@ -217,7 +234,7 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="WriteToCSV" type="PythonConfigurationType" factoryName="Python" temporary="true">
<configuration name="TinnitusAnalyse_GUI" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="TinnitusAnalyse" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
@@ -229,7 +246,7 @@
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/WriteToCSV.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/TinnitusAnalyse_GUI.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
@@ -240,10 +257,11 @@
</configuration>
<recent_temporary>
<list>
<item itemvalue="Python.DigitalFilter1" />
<item itemvalue="Python.TinnitusAnalyse_GUI" />
<item itemvalue="Python.SoundGenerator" />
<item itemvalue="Python.WriteToCSV" />
<item itemvalue="Python.DigitalFilter" />
<item itemvalue="Python.Noise Experiment" />
<item itemvalue="Python.DigitalFilter1" />
</list>
</recent_temporary>
</component>
@@ -269,13 +287,13 @@
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.2548714" />
<window_info anchor="bottom" id="Run" order="2" weight="0.2548714" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.39977604" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Version Control" order="7" />
<window_info anchor="bottom" id="Terminal" order="8" />
<window_info anchor="bottom" id="Terminal" order="8" weight="0.32969603" />
<window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
<window_info anchor="bottom" id="Python Console" order="10" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
@@ -314,6 +332,13 @@
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python35/Lib/site-packages/matplotlib/axes/_base.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3349">
<caret line="230" selection-start-line="230" selection-end-line="230" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python35/Lib/tkinter/ttk.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="9367">
@@ -321,39 +346,49 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/DigitalFilter1.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1201">
<caret line="81" column="28" lean-forward="true" selection-start-line="81" selection-start-column="28" selection-end-line="81" selection-end-column="28" />
<folding>
<element signature="e#0#47#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/TinnitusAnalyse_GUI.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="17">
<caret line="14" selection-start-line="14" selection-end-line="14" />
<state relative-caret-position="805">
<caret line="122" lean-forward="true" selection-start-line="122" selection-end-line="122" />
<folding>
<element signature="e#0#117#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python35/Lib/site-packages/matplotlib/axes/_base.py">
<entry file="file://$PROJECT_DIR$/Noise Experiment.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<caret line="230" selection-start-line="230" selection-end-line="230" />
<state>
<caret column="27" selection-start-column="27" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/SoundGenerator.py">
<entry file="file://$PROJECT_DIR$/DigitalFilter.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="688">
<caret line="80" column="119" lean-forward="true" selection-start-line="80" selection-start-column="60" selection-end-line="80" selection-end-column="119" />
<state relative-caret-position="354">
<caret line="28" lean-forward="true" selection-start-line="28" selection-end-line="28" />
<folding>
<element signature="e#0#11#0" expanded="true" />
<element signature="e#0#47#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/DigitalFilter1.py">
<entry file="file://$PROJECT_DIR$/SoundGenerator.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1782">
<caret line="81" column="28" lean-forward="true" selection-start-line="81" selection-start-column="28" selection-end-line="81" selection-end-column="28" />
<state relative-caret-position="520">
<caret line="62" column="32" lean-forward="true" selection-start-line="62" selection-start-column="32" selection-end-line="62" selection-end-column="32" />
<folding>
<element signature="e#0#47#0" expanded="true" />
<element signature="e#0#11#0" expanded="true" />
</folding>
</state>
</provider>

+ 0
- 96
TinnitusAnalyse/DigitalFilter.py View File

@@ -1,96 +0,0 @@
import matplotlib.pyplot as plt # For plotting
from math import sin, pi, cos # For generating input signals
import numpy as np
import sys # For reading command line arguments


fs = 44100 # sampling frequency (Abtastfrequenz)

koeff = {
"b0": 0,
"b1": 0,
"b2": 0,
"a1": 0,
"a2": 0
}

def koeffizienten_berechnen(omega, r):
# Koeffizientenberechnung nach Tobola VL S.107 - IIR Filter, 2. Ordnung
koeff["b0"] = 1
koeff["b1"] = 0
koeff["b2"] = -1
koeff["a1"] = -2*r*cos(omega)
koeff["a2"] = r**2

def filter(x):
y = [0]*len(x)
for k in range(4, len(x)):
y[k] = koeff["b0"]*x[k] + koeff["b1"]*x[k-1] + koeff["b2"]*x[k-2] - koeff["a1"]*y[k-1] - koeff["a2"]*y[k-2]

return y




dauer_ms = 10000 # 10 Sekunden
num_samples = dauer_ms * (fs / 1000) # framerate -pro Sekunde- umgerechnet in -pro Millisekunde-

t = np.linspace(0, 10, int(num_samples)) # array zum darstellen der x-Achse
amp = 1

f_input1 = 1
f_input2 = 5
f_input3 = 10

input1 = []
input2 = []
input3 = []
for x in range(int(num_samples)): # einen einfachen Sinus ins array schreiben
input1.append(amp * sin(2 * pi * f_input1 * (x / fs)))
input2.append(amp * sin(2 * pi * f_input2 * (x / fs)))
input3.append(amp * sin(2 * pi * f_input3 * (x / fs)))


input_ges = np.add(input1, input2) # Sinus aufaddieren um ein halbwegs realistisches Audiosignal zu bekommen
#input_ges = np.add(input_ges, input3)

#Filterparameter hier einstellen
fr = 5
omega = 2*pi*fr/fs
r = 0.01
koeffizienten_berechnen(omega, r) # Koeffizienten berechnen mit Mittelfrequenz 10Hz

output = filter(input_ges)

### Plot the signals for comparison
plt.figure(1)
plt.subplot(231)
plt.ylabel('Amplitude')
plt.xlabel('t [s]')
plt.title('Input1 f=' + str(f_input1) + "Hz")
plt.plot(t, input1)

plt.subplot(232)
plt.ylabel('Amplitude')
plt.xlabel('t [s]')
plt.title('Input2 f=' + str(f_input2) + "Hz")
plt.plot(t, input2)

# plt.subplot(233)
# plt.ylabel('Amplitude')
# plt.xlabel('t [s]')
# plt.title('Input3 f=' + str(f_input3) + "Hz")
# plt.plot(t, input3)

plt.subplot(234)
plt.ylabel('Amplitude')
plt.xlabel('t [s]')
plt.title('input_ges = i1 + i2')
plt.plot(t, input_ges)

plt.subplot(235)
plt.ylabel('Amplitude')
plt.xlabel('Samples')
plt.title('gefiltertes Signal mit Resonanzfrequenz = ' + str(fr) + "Hz")
plt.plot(t, output)
plt.show()

+ 1
- 1
TinnitusAnalyse/SoundGenerator.py View File

@@ -55,7 +55,7 @@ class Sound:
audio = []
self.tinnitus = tinnitus
self.name = name
self.audio = audio # ein Array, in das die Sound-Werte geschrieben werden
self.audio = audio # ein Array, in das die Sound-Werte geschrieben werden (von -1, bis +1)
self.nchannels = nchannels # Zahl der audio channels (1:mono 2:stereo)
self.sampwidth = sampwidth # Größe eines einzelnen Sound-Werts (in bytes)
self.framerate = framerate # Abtastrate

+ 24
- 21
TinnitusAnalyse/TinnitusAnalyse_GUI.py View File

@@ -107,6 +107,7 @@ def unten_button_speichern_press():
tinnitus.kommentar = untenTextKommentar.get("1.0", END)
print("Speichere Patientendaten, siehe TinnitusDaten.csv")
tinnitus.speichern()
sound.wav_speichern()


def unten_button_play_press():
@@ -129,15 +130,17 @@ print("test")
root = Tk() # build the main window
root.title("Tinnitus Analyse")
#root.iconbitmap('headphones.ico') #todo: fix icon
#root.minsize(width=200, height=600)
root.minsize(width=800, height=500)
root.resizable(True, True)
root.columnconfigure(0, weight=1) # falls freier Platz im Fenster ist, werden die Frames diesen benutzen
root.columnconfigure(0, weight=1)
root.columnconfigure(1, weight=1)
root.rowconfigure(0, weight=1)


"""------------------------------------------LINKER FRAME------------------------------------------------------------"""
linkerFrame = LabelFrame(root, text="Linkes Ohr", font="bold") # parent is root, padding is extra space at the edges
linkerFrame.grid(column=0, row=0, sticky=(N + W + E)) # the frame sticks to every side of the window when resized
linkerFrame.grid(column=0, row=0, sticky=(N+W+E+S)) # the frame sticks to every side of the window when resized


linksLautstärke = DoubleVar()
linksFrequenz = DoubleVar()
@@ -147,44 +150,45 @@ linksRauschenFrequenzband = DoubleVar()
# ------------------ LAUTSTÄRKE ------------------
linksLabelLautstärke = Label(linkerFrame, text="Lautstärke [%]:")
linksLabelLautstärke.grid(column=0, row=0, sticky=W)
linksScaleLautstärke = Scale(linkerFrame, from_=0, to=100, orient=HORIZONTAL, length=700,
linksScaleLautstärke = Scale(linkerFrame, from_=0, to=100, orient=HORIZONTAL, length=400,
command=links_scale_lautstärke_change)
linksScaleLautstärke.grid(column=1, row=0, columnspan=10, sticky=W)
linksScaleLautstärke.grid(column=1, row=0, sticky=N+S+W+E)

# -------- FREQUENZ ------------------------
linksLabelFrequenz = Label(linkerFrame, text="Frequenz [kHz]")
linksLabelFrequenz.grid(column=0, row=1, sticky=W) # sticky = w(est) makes the text left aligned
linksScaleFrequenz = Scale(linkerFrame, from_=0, to=20, orient=HORIZONTAL, length=700, resolution=-1.0,
linksScaleFrequenz = Scale(linkerFrame, from_=0, to=20, orient=HORIZONTAL, length=400, resolution=-1.0,
command=links_scale_frequenz_change)
linksScaleFrequenz.grid(column=1, row=1, columnspan=10, sticky=(W+E))
linksScaleFrequenz.grid(column=1, row=1, sticky=(W+E))

# ----------- ABTRENNSTRICH ----------------
linksSeparator = Separator(linkerFrame, orient="horizontal")
linksSeparator.grid(column=0, row=2, columnspan=10, sticky=(W + E))
linksSeparator.grid(column=0, row=2, sticky=(W + E), columnspan=3)

# ----------- RAUSCHEN --------------------
linksLabelRauschenLautstärke = Label(linkerFrame, text="Rauschen Lautstärke %", anchor="w")
linksLabelRauschenLautstärke.grid(column=0, row=3, sticky=W)
linksScaleRauschenLautstärke = Scale(linkerFrame, from_=0, to=100, orient=HORIZONTAL, length=700,
linksScaleRauschenLautstärke = Scale(linkerFrame, from_=0, to=100, orient=HORIZONTAL, length=400,
command=links_scale_rauschen_lautstärke_change)
linksScaleRauschenLautstärke.grid(column=1, row=3, sticky=(W+E))

linksLabelRauschenMittelFrequenz = Label(linkerFrame, text="Rauschen Mittelfrequenz [kHz]", anchor="w")
linksLabelRauschenMittelFrequenz .grid(column=0, row=4)
linksScaleRauschenMittelFrequenz = Scale(linkerFrame, from_=0, to=20, orient=HORIZONTAL, length=700, resolution=-1.0,
linksLabelRauschenMittelFrequenz .grid(column=0, row=4, sticky=(W+E))
linksScaleRauschenMittelFrequenz = Scale(linkerFrame, from_=0, to=20, orient=HORIZONTAL, length=400, resolution=-1.0,
command=links_scale_rauschen_mittelfrequenz_change)
linksScaleRauschenMittelFrequenz.grid(column=1, row=4)
linksScaleRauschenMittelFrequenz.grid(column=1, row=4, sticky=(W+E))

linksLabelRauschenBandbreite= Label(linkerFrame, text="Rauschen Bandbreite [kHz]", anchor="w")
linksLabelRauschenBandbreite.grid(column=0, row=5, sticky=W)
linksScaleRauschenBandbreite = Scale(linkerFrame, from_=0, to=20, orient=HORIZONTAL, length=700, resolution=-1.0,
linksScaleRauschenBandbreite = Scale(linkerFrame, from_=0, to=20, orient=HORIZONTAL, length=400, resolution=-1.0,
command=links_scale_rauschen_bandbreite_change)
linksScaleRauschenBandbreite.grid(column=1, row=5, sticky=(W+E))


"""----------------------------------------------RECHTER FRAME-------------------------------------------------------"""
rechterFrame = LabelFrame(root, text="Rechtes Ohr", font="bold")
rechterFrame.grid(column=2, row=0, sticky=(N + E + W))
rechterFrame.grid(column=2, row=0, sticky=(N+E+W+S))


# Variablen Rechts
rechtsFrequenz = DoubleVar()
@@ -195,14 +199,14 @@ rechtsLautstärke = DoubleVar()
# ------------------ LAUTSTÄRKE ------------------
rechtsLabelLautstärke = Label(rechterFrame, text="Lautstärke [%]:")
rechtsLabelLautstärke.grid(column=0, row=0, sticky=W)
rechtsScaleLautstärke = Scale(rechterFrame, from_=0, to=100, orient=HORIZONTAL, length=700,
rechtsScaleLautstärke = Scale(rechterFrame, from_=0, to=100, orient=HORIZONTAL, length=400,
command=rechts_scale_lautstärke_change)
rechtsScaleLautstärke.grid(column=1, row=0, columnspan=10, sticky=W)

# -------- FREQUENZ ------------------------
rechtsLabelFrequenz = Label(rechterFrame, text="Frequenz [kHz]")
rechtsLabelFrequenz.grid(column=0, row=1, sticky=W) # sticky = w(est) makes the text left aligned
rechtsScaleFrequenz = Scale(rechterFrame, from_=0, to=20, orient=HORIZONTAL, length=700, resolution=-1.0,
rechtsScaleFrequenz = Scale(rechterFrame, from_=0, to=20, orient=HORIZONTAL, length=400, resolution=-1.0,
command=rechts_scale_frequenz_change)
rechtsScaleFrequenz.grid(column=1, row=1, columnspan=10, sticky=(W+E))

@@ -213,26 +217,26 @@ rechtsSeparator.grid(column=0, row=2, columnspan=10, sticky=(W + E))
# ----------- RAUSCHEN --------------------
rechtsLabelRauschenLautstärke = Label(rechterFrame, text="Rauschen Lautstärke %", anchor="w")
rechtsLabelRauschenLautstärke.grid(column=0, row=3, sticky=W)
rechtsScaleRauschenLautstärke = Scale(rechterFrame, from_=0, to=100, orient=HORIZONTAL, length=700,
rechtsScaleRauschenLautstärke = Scale(rechterFrame, from_=0, to=100, orient=HORIZONTAL, length=400,
command=rechts_scale_rauschen_lautstärke_change)
rechtsScaleRauschenLautstärke.grid(column=1, row=3, sticky=(W+E))

rechtsLabelRauschenMittelFrequenz = Label(rechterFrame, text="Rauschen Mittelfrequenz [kHz]", anchor="w")
rechtsLabelRauschenMittelFrequenz .grid(column=0, row=4)
rechtsScaleRauschenMittelFrequenz = Scale(rechterFrame, from_=0, to=20, orient=HORIZONTAL, length=700, resolution=-1.0,
rechtsScaleRauschenMittelFrequenz = Scale(rechterFrame, from_=0, to=20, orient=HORIZONTAL, length=400, resolution=-1.0,
command=rechts_scale_rauschen_mittelfrequenz_change)
rechtsScaleRauschenMittelFrequenz.grid(column=1, row=4)

rechtsLabelRauschenBandbreite = Label(rechterFrame, text="Rauschen Bandbreite [kHz]", anchor="w")
rechtsLabelRauschenBandbreite.grid(column=0, row=5, sticky=W)
rechtsScaleRauschenBandbreite = Scale(rechterFrame, from_=0, to=20, orient=HORIZONTAL, length=700, resolution=-1.0,
rechtsScaleRauschenBandbreite = Scale(rechterFrame, from_=0, to=20, orient=HORIZONTAL, length=400, resolution=-1.0,
command=rechts_scale_rauschen_bandbreite_change)
rechtsScaleRauschenBandbreite.grid(column=1, row=5, sticky=(W+E))


"""------------------------------------------------ UNTERER FRAME----------------------------------------------------"""
untererFrame = LabelFrame(root, text="Generelles", border=10)
untererFrame.grid(column=0, row=1, sticky=(N + W + S))
untererFrame.grid(column=0, row=1, sticky=(N + W + S), columnspan=2)

vorname = StringVar() # Name des Patienten als String um den generierten Tinnitus später zuordnen zu können
nachname = StringVar()
@@ -290,7 +294,6 @@ untenButtonSpeichern.grid(column=4, row=6, sticky=S)



# todo: , relief="raised" für play button


root.mainloop()

+ 10
- 6
TinnitusAnalyse/TinnitusDaten.csv View File

@@ -1,6 +1,10 @@
linke Frequenz;1890.0
linke Lautstärke;0.18
linkes Rauschen;0
rechte Frequenz;600
rechte Lautstärke;0
rechtes Rauschen;0
Vorname;asdas
Nachname;asda
linke Frequenz;1410.0
linke Lautstärke;0.03
linkes Rauschen;0.0
rechte Frequenz;0.0
rechte Lautstärke;0.0
rechtes Rauschen;0.0
Kommentar;


BIN
TinnitusAnalyse/__pycache__/SoundGenerator.cpython-35.pyc View File


Loading…
Cancel
Save