Imports BasicDSP Module dsp3ex3 Const WINTIME As Double = 0.03 Const STPTIME As Double = 0.01 Sub Main(ByVal args() As String) ' check arguments If args.Length = 0 Then Console.WriteLine("usage: fbankconsole input.wav") Environment.Exit(1) End If ' read in a WAV audio file Dim wv As New Signal If Not wv.LoadWaveFile(args(0)) Then Console.WriteLine("could not open file: " & args(0)) Environment.Exit(1) End If ' get processing parameters Dim wsize As Integer = WINTIME / wv.Period Dim ssize As Integer = STPTIME / wv.Period Dim np As Integer = wv.Rate / 1000 Dim pe As Double For i As Integer = 0 To wv.Count - wsize Step ssize ' get section of signal Dim win As Waveform = wv.Cut(i, wsize).Float ' estimate filter Dim pc As LTISystem = LPC.Auto(win, np, pe) ' get roots of filter polynomial Dim roots() As Complex = LPC.Roots(pc.b, np) ' display frequencies Dim t As Double = i * wv.Period Console.Write(t.ToString("F04") & ":") For j As Integer = 1 To np Dim f As Integer = Math.Atan2(roots(j).Imag, roots(j).Real) * _ wv.Rate / (2 * Math.PI) If (f > 0) And (f < 5000) Then Console.Write(" " & f) End If Next Console.WriteLine() Next End Sub End Module