Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » VB.NET » Hardware » Downloads
 
Add your own
alternative version

Sound Scanner and FFT Analyzer

, 16 Feb 2010
Scanning analog input, and FFT convertion and analyzing.
SoundScan.zip
SoundScan
bin
Debug
ICO_FKR.ico
SoundAnalysis.dll
ICO_FKR.ico
My Project
Application.myapp
Settings.settings
PORT.DLL
SoundAnalysis.dll
SoundScan_Feb112010.zip
SoundScan
bin
Debug
ICO_FKR.ico
SoundAnalysis.dll
SoundScan.exe
SoundScan.pdb
SoundScan.vshost.exe
ICO_FKR.ico
My Project
Application.myapp
Settings.settings
obj
Debug
ResolveAssemblyReference.cache
SoundScan.exe
SoundScan.Frm_Detailed.resources
SoundScan.Frm_SoundScan.resources
SoundScan.pdb
SoundScan.Resources.resources
SoundScan.vbproj.GenerateResource.Cache
TempPE
PORT.DLL
SoundAnalysis.dll
SoundScan_Feb132010.zip
ICO_FKR.ico
SoundAnalysis.dll
SoundScan.exe
SoundScan.pdb
SoundScan.vshost.exe
ICO_FKR.ico
Application.myapp
Settings.settings
ResolveAssemblyReference.cache
SoundScan.exe
SoundScan.Frm_Detailed.resources
SoundScan.Frm_SoundScan.resources
SoundScan.pdb
SoundScan.Resources.resources
SoundScan.vbproj.GenerateResource.Cache
PORT.DLL
SoundAnalysis.dll
SoundScan.suo
Imports System.Windows.Forms

Public Class Frm_Detailed

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    Private Sub Frm_Detailed_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            Dim _I As Integer, _Index As Integer = -1
            Dim _J As Integer = 0
            Dim _Max As Double = -1000
            Dim _PointF As PointF = New PointF(-1, -1)
            Dim _Arr_Refined() As PointF
            Dim _Flag As Boolean = False
            For _I = 0 To UBound(Frm_SoundScan._Arr_Spec) - (UBound(Frm_SoundScan._Arr_Spec) * 0.05)
                If _Max < Frm_SoundScan._Arr_Spec(_I) Then
                    _Max = Frm_SoundScan._Arr_Spec(_I)
                    _Index = _I
                End If
            Next
            LstBox_Raw_Detailed.Items.Clear()
            LstBox_Raw_Detailed.Items.Add("Raw FFT Array")
            LstBox_Raw_Detailed.Items.Add("No. : " & vbTab & vbTab & "Value")
            For _I = 0 To (CInt(UBound(Frm_SoundScan._Arr_Spec) / 2) + 1)
                LstBox_Raw_Detailed.Items.Add(_I & " : " & vbTab & vbTab & (Frm_SoundScan._Arr_Spec(_I) * 100 / _Max).ToString("0.00") & " %")
            Next
            ReDim _Arr_Refined((CInt(UBound(Frm_SoundScan._Arr_Spec) / 2) + 1))
            For _I = 0 To UBound(_Arr_Refined)
                _Arr_Refined(_I) = New PointF(CSng((Frm_SoundScan._Size * _I) / (Frm_SoundScan._Arr_Spec.Length)), CSng(Frm_SoundScan._Arr_Spec(_I) * 100 / _Max))
            Next
            LstBox_Refined_Details.Items.Clear()
            LstBox_Refined_Details.Items.Add("Refined Information")
            LstBox_Refined_Details.Items.Add("Frequency : " & vbTab & "Effective Value")
            For _I = 0 To UBound(_Arr_Refined) - 1
                _Flag = False
                For _J = _I + 1 To UBound(_Arr_Refined)
                    If _Arr_Refined(_J).Y > _Arr_Refined(_I).Y Then
                        _PointF = _Arr_Refined(_I)
                        _Arr_Refined(_I) = _Arr_Refined(_J)
                        _Arr_Refined(_J) = _PointF
                        _Flag = True
                    End If
                Next
                If Not _Flag Then Exit For
            Next
            For _I = 0 To UBound(_Arr_Refined)
                LstBox_Refined_Details.Items.Add(_Arr_Refined(_I).X.ToString("0000.0") & "   x" & (1000 / Frm_SoundScan._Time_Interval).ToString("0") & " Hz : " & vbTab & vbTab & _Arr_Refined(_I).Y.ToString("0.00") & " %")
            Next
            Return
        Catch ex As Exception
            MsgBox(ex.ToString, MsgBoxStyle.Critical, "FKR_Fast Fourier Transition Tester")
            Return
        End Try
    End Sub

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Common Development and Distribution License (CDDL)

About the Author

Mahdi Mansouri
Engineer
Malaysia Malaysia
PhD Candidate in Biomedical Eng., Control
M.Eng Electronics, Control
B.Eng Computer, Hardware
That's all ;D !

| Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 16 Feb 2010
Article Copyright 2010 by Mahdi Mansouri
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid