FFT - Fourier-Analysis

Ein prima Notebook zur Veranschaulichung:





Die erste Zeile der Zelle mit der Bezeichnung "In [86]:" muss allerdings wie folgt abgeändert werden:


N = int(len(Y)/2+1)


Weiterführendes:




Anderes:

Cro beerdigt seine Maske Verwandtschaft: Über Verwandte | ZEITmagazin Mars-Mission: Nasa schießt Rover zum roten Planeten - Ratgeber - Bild.de Corona-Spätschäden bei Covid-19-Patienten: Atemnot, Gedächtnislücken, Taubheit - DER SPIEGEL US-Wahl: Trump bringt Wahlverschiebung ins Spiel - Politik - SZ.de Mars 2020: "Perservance" soll Atemtechnik erforschen - Wissen - SZ.de Alle wollen hin: Der Mars als große Versuchung - news.ORF.at Tönnies: Warum der Konzern 15 Tochterfirmen trotz Verbot von Werkverträgen gründet - DER SPIEGEL Maisha-Maureen Auma: "Rassismus hat übrigens nichts mit der Hautfarbe zu tun." | ZEIT Campus No Longer in Shadows, Pentagon’s U.F.O. Unit Will Make Some Findings Public - The New York Times Außerirdische Raumschiffe im Besitz? Pentagon untersucht doch UFO-Sichtungen | heise online
Aya Jaff über KI, Karrieretipps und Sexismus in der Tech-Branche (Interview) - Gerechtigkeit - bento WWF: Drei Milliarden tote und vertriebene Tiere nach Bränden in Australien | ZEIT ONLINE Social Media: Türkei verabschiedet Gesetz zur Kontrolle sozialer Medien | ZEIT ONLINE Ivanka Trump's alternative universe - CNNPolitics Even Donald Trump knows he is in deep, deep trouble in the 2020 race - CNNPolitics Japan's air force faces a 'relentless' burden, imposed by China - CNN Politico accidentally reports Biden picked Kamala Harris as his running mate | Fox News Biden's notes suggest Kamala Harris may be his chosen running mate: reports | Fox News Brad Pitt scores Emmy nomination for playing Fauci on 'SNL' - CNN USA: „Niemand mag mich“ – Trump beklagt seine sinkende Popularität - WELT Donald Trump über seine Beliebtheit: "Niemand mag mich" - DER SPIEGEL Prozess gegen Halle-Attentäter: Der Terrorist aus dem Kinderzimmer - WELT Ägypten: "Die Bedrohung ist immer da" | ZEIT ONLINE Vereinigte Staaten: Demokraten lehnen Vorschlag der Republikaner zu neuem Corona-Hilfspaket ab Collins asks Trump: Why aren't medical experts at briefing? Trump abruptly ends briefing after being pressed over retweeting misinformation - CNNPolitics Trump wirbt erneut für Malariamittel - und bricht Pressekonferenz ab - DER SPIEGEL John Lennon: How Yoko Ono came face-to-face with May Pang after Beatle's AFFAIR | Music | Entertainment | Express.co.uk Billie Eilish My Future release date: When is new single My Future coming out? | Music | Entertainment | Express.co.uk Elvis Presley Tom Parker: Was Colonel Tom Parker a good manager? 'Not a Svengali' | Music | Entertainment | Express.co.uk John Lennon: Beatle's son Julian on star leaving family 'in bits': 'He was a hypocrite' | Music | Entertainment | Express.co.uk John Lennon: Beatles singer ‘SHOCKED’ by own behaviour after fight in unearthed interview | Music | Entertainment | Express.co.uk (4) The Ultimate John Lennon Interview: An Overview of His Entire Solo Career (1980) - YouTube

(ein paar Links können bereits im letzten Post enthalten sein; sorry, wenn! - bin nur grade zu faul zu sehr in Eile, das abzuchecken)

#################################################

Fans sperren George R.R. Martin in Hütte ein


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Vorschau auf kommenden Post

Es wird weitergehen mit dem Drum-Triggering.

Kurze Aufnahme für Analysezwecke:



Code

# https://stackoverflow.com/questions/43877971/librosa-pitch-tracking-stftimport librosa
import peakutils
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

# CSV einlesenfreqnote = pd.read_csv('freqnote.csv',sep=';',header=None)
print(freqnote)
freqnote[3] = pd.to_numeric(freqnote[3], downcast="float")
print(freqnote[1].where(freqnote[3] >= 350))
result_index = freqnote[3].sub(350).abs().idxmin()
print("Resultat:", freqnote[1][result_index])

def get_note(freq):
# https://codereview.stackexchange.com/questions/204549/lookup-closest-value-in-pandas-dataframe result_index = freqnote[3].sub(freq).abs().idxmin()
note = freqnote[1][result_index]
return note

def detect_pitch(t):
index = magnitudes[:, t].argmax()
pitch = pitches[index, t]

return pitch



filename = '/home/Musik/FFT/drumtriggering_1.wav'y, sr = librosa.load(filename)

y = y[:]


n_fft = 2048
#pitches, magnitudes = librosa.core.piptrack(y=y, sr=sr, fmin=75, fmax=1600)pitches, magnitudes = librosa.core.piptrack(y=y, sr=sr, n_fft=n_fft)



indexes = peakutils.indexes(y, thres=0.15/max(y), min_dist=10240)
x = np.linspace(0, len(y)-1, len(y))
print("Shape x:", x.shape)
print("Shape y:", y.shape)
print("Index 1:", indexes[1])
print("y 1:", y[1])

peakpitches = []
for i in range(0,len(y)):
peakpitches.append(0)

peakpitches = np.array(peakpitches)

for index in indexes:
print("Peak-Index:", index)
t = int(index/n_fft)
pitch = detect_pitch(t)
note = get_note(pitch)
print("T:", t)
print("Pitch:", pitch, "Note:", note)
peakpitches[index]= pitch/100

plt.plot(y)
plt.plot(indexes, peakpitches[indexes], "X")
plt.plot(indexes, y[indexes], "o")
plt.plot(np.zeros_like(y), "--", color="gray")
plt.show()
...
Resultat: F4
Shape x: (286650,)
Shape y: (286650,)
Index 1: 13906
y 1: 0.0018520372
Peak-Index: 3340
T: 1
Pitch: 0.0 Note: A0
Peak-Index: 13906
T: 6
Pitch: 1167.588 Note: D6
Peak-Index: 32665
T: 15
Pitch: 0.0 Note: A0
Peak-Index: 43656
T: 21
Pitch: 204.1382 Note: G#3/Ab3
Peak-Index: 54654
T: 26
Pitch: 0.0 Note: A0
Peak-Index: 65665
T: 32
Pitch: 199.21727 Note: G3
Peak-Index: 79138
T: 38
Pitch: 0.0 Note: A0
Peak-Index: 97805
T: 47
Pitch: 198.38155 Note: G3
Peak-Index: 113354
T: 55
Pitch: 0.0 Note: A0
Peak-Index: 130734
T: 63
Pitch: 216.85878 Note: A3
Peak-Index: 145422
T: 71
Pitch: 196.19327 Note: G3
Peak-Index: 159106
T: 77
Pitch: 302.1576 Note: D4
Peak-Index: 172007
T: 83
Pitch: 159.59619 Note: D#3/Eb3
Peak-Index: 184606
T: 90
Pitch: 206.41318 Note: G#3/Ab3
Peak-Index: 204391
T: 99
Pitch: 0.0 Note: A0
Peak-Index: 214852
T: 104
Pitch: 0.0 Note: A0
Peak-Index: 229784
T: 112
Pitch: 0.0 Note: A0
Peak-Index: 248851
T: 121
Pitch: 0.0 Note: A0
Peak-Index: 262418
T: 128
Pitch: 233.97658 Note: A#3/Bb3
Peak-Index: 274927
T: 134
Pitch: 266.73358 Note: C4[3]
Peak-Index: 285361
T: 139
Pitch: 248.22389 Note: B3



Und mit erhöhtem Treshold-Wert:






Wie wir sehen, stimmt hier einiges noch ganz und gar nicht ;-)

Wave-File - Trigger 1 & Trigger 2 - Analyse mit Audacity




Und auch die Audacity-Schnellanalyse macht noch nicht wirklich glücklich. Das mag aber zum größten Teil an mir liegen ... mer schau'n mal (demnächst genauer hin uso) ...

Kommentare

Beliebte Posts aus diesem Blog

Betreuervergütung – Betreuungsrecht-Lexikon

Ich schreibe wie?

Praktisch erledigt.