diff --git a/Software/Matlab STFT Program/300hz.wav b/Software/Matlab STFT Program/300hz.wav deleted file mode 100644 index fe254c4..0000000 Binary files a/Software/Matlab STFT Program/300hz.wav and /dev/null differ diff --git a/Software/Matlab STFT Program/STFT_TEST.m b/Software/Matlab STFT Program/STFT_TEST.m deleted file mode 100644 index c9285ea..0000000 --- a/Software/Matlab STFT Program/STFT_TEST.m +++ /dev/null @@ -1,47 +0,0 @@ -clear, clc, close all - -% load a .wav file -[x, fs] = audioread('ppl2.wav'); % load an audio file -x = x(:, 1); % get the first channel - -% define analysis parameters -xlen = length(x); % length of the signal -wlen = 512; % window length (recomended to be power of 2) -hop = wlen/4; % hop size (recomended to be power of 2) -nfft = 1024; % number of fft points (recomended to be power of 2) - -% perform STFT -[S, f, t] = stft(x, wlen, hop, nfft, fs); - -% define the coherent amplification of the window -K = sum(hamming(wlen, 'periodic'))/wlen; - -% take the amplitude of fft(x) and scale it, so not to be a -% function of the length of the window and its coherent amplification -S = abs(S)/wlen/K; - -% correction of the DC & Nyquist component -if rem(nfft, 2) % odd nfft excludes Nyquist point - S(2:end, :) = S(2:end, :).*2; -else % even nfft includes Nyquist point - S(2:end-1, :) = S(2:end-1, :).*2; -end - -% convert amplitude spectrum to dB (min = -120 dB) -S = 20*log10(S + 1e-6); - -% plot the spectrogram -figure(1) -surf(t, f, S) -shading interp -axis tight -box on -view(0, 90) -set(gca, 'FontName', 'Times New Roman', 'FontSize', 14) -xlabel('Time, s') -ylabel('Frequency, Hz') -title('Amplitude spectrogram of the signal') - -handl = colorbar; -set(handl, 'FontName', 'Times New Roman', 'FontSize', 14) -ylabel(handl, 'Magnitude, dB') \ No newline at end of file diff --git a/Software/Matlab STFT Program/desk_Ver.wav b/Software/Matlab STFT Program/desk_Ver.wav deleted file mode 100644 index ada0e26..0000000 Binary files a/Software/Matlab STFT Program/desk_Ver.wav and /dev/null differ diff --git a/Software/Matlab STFT Program/metal.wav b/Software/Matlab STFT Program/metal.wav deleted file mode 100644 index c71299b..0000000 Binary files a/Software/Matlab STFT Program/metal.wav and /dev/null differ diff --git a/Software/Matlab STFT Program/plastics.wav b/Software/Matlab STFT Program/plastics.wav deleted file mode 100644 index 693d76b..0000000 Binary files a/Software/Matlab STFT Program/plastics.wav and /dev/null differ diff --git a/Software/Matlab STFT Program/stft.m b/Software/Matlab STFT Program/stft.m deleted file mode 100644 index cb70ef4..0000000 --- a/Software/Matlab STFT Program/stft.m +++ /dev/null @@ -1,56 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Short-Time Fourier Transform % -% with MATLAB Implementation % -% % -% Author: M.Sc. Eng. Hristo Zhivomirov 12/21/13 % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -function [stft, f, t] = stft(x, wlen, hop, nfft, fs) - -% function: [stft, f, t] = stft(x, wlen, hop, nfft, fs) -% x - signal in the time domain -% wlen - length of the analysis Hamming window -% hop - hop size -% nfft - number of FFT points -% fs - sampling frequency, Hz -% stft - STFT matrix (only unique points, time across columns, freq across rows) -% f - frequency vector, Hz -% t - time vector, s - -% represent x as column-vector -x = x(:); - -% length of the signal -xlen = length(x); - -% form a periodic hamming window -win = hamming(wlen, 'periodic'); - -% stft matrix estimation and preallocation -rown = ceil((1+nfft)/2); % calculate the total number of rows -coln = 1+fix((xlen-wlen)/hop); % calculate the total number of columns -stft = zeros(rown, coln); % form the stft matrix - -% initialize the signal time segment index -indx = 0; - -% perform STFT -for col = 1:coln - % windowing - xw = x(indx+1:indx+wlen).*win; - - % FFT - X = fft(xw, nfft); - - % update the stft matrix - stft(:, col) = X(1:rown); - - % update the index - indx = indx + hop; -end - -% calculate the time and frequency vectors -t = (wlen/2:hop:wlen/2+(coln-1)*hop)/fs; -f = (0:rown-1)*fs/nfft; - -end \ No newline at end of file diff --git a/Software/Matlab STFT Program/wood.wav b/Software/Matlab STFT Program/wood.wav deleted file mode 100644 index 3900969..0000000 Binary files a/Software/Matlab STFT Program/wood.wav and /dev/null differ diff --git a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/Form1.Designer.cs b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/Form1.Designer.cs index 090de50..8821d31 100644 --- a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/Form1.Designer.cs +++ b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/Form1.Designer.cs @@ -136,6 +136,10 @@ private void InitializeComponent() // // chart1 // + chartArea1.AxisX.Title = "Frequency, Hz"; + chartArea1.AxisX.TitleFont = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + chartArea1.AxisY.Title = "Amplitude, dB"; + chartArea1.AxisY.TitleFont = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); chartArea1.Name = "ChartArea1"; this.chart1.ChartAreas.Add(chartArea1); legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top; @@ -143,6 +147,7 @@ private void InitializeComponent() this.chart1.Legends.Add(legend1); this.chart1.Location = new System.Drawing.Point(0, 0); this.chart1.Name = "chart1"; + this.chart1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; series1.BorderWidth = 5; series1.ChartArea = "ChartArea1"; series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point; diff --git a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/Form1.cs b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/Form1.cs index e3be35f..127bcd5 100644 --- a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/Form1.cs +++ b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/Form1.cs @@ -32,7 +32,7 @@ public Form1() - string input_1_path = @"C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\SmartCane_Monitoring\SmartCane_Monitoring\wood.txt"; + string input_1_path = @"C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\object classification by sound with k-nn algorithm\SmartCane_Monitoring\wood.txt"; string[] input_1_name = System.IO.File.ReadAllLines(input_1_path); for (int i = 0; i < input_1_name.Length; i++) @@ -52,7 +52,7 @@ public Form1() } - string input_2_path = @"C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\SmartCane_Monitoring\SmartCane_Monitoring\paper.txt"; + string input_2_path = @"C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\object classification by sound with k-nn algorithm\SmartCane_Monitoring\paper.txt"; string[] input_2_name = System.IO.File.ReadAllLines(input_2_path); for (int i = 0; i < input_2_name.Length; i++) @@ -70,7 +70,7 @@ public Form1() } - string input_3_path = @"C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\SmartCane_Monitoring\SmartCane_Monitoring\plastic.txt"; + string input_3_path = @"C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\object classification by sound with k-nn algorithm\SmartCane_Monitoring\plastic.txt"; string[] input_3_name = System.IO.File.ReadAllLines(input_3_path); for (int i = 0; i < input_3_name.Length; i++) @@ -87,7 +87,7 @@ public Form1() } - string input_4_path = @"C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\SmartCane_Monitoring\SmartCane_Monitoring\metal.txt"; + string input_4_path = @"C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\object classification by sound with k-nn algorithm\SmartCane_Monitoring\metal.txt"; string[] input_4_name = System.IO.File.ReadAllLines(input_4_path); diff --git a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/bin/Debug/SmartCane_Monitoring.exe b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/bin/Debug/SmartCane_Monitoring.exe index 66ea890..36b8cee 100644 Binary files a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/bin/Debug/SmartCane_Monitoring.exe and b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/bin/Debug/SmartCane_Monitoring.exe differ diff --git a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/bin/Debug/SmartCane_Monitoring.pdb b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/bin/Debug/SmartCane_Monitoring.pdb index 21c3fc1..5e994b9 100644 Binary files a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/bin/Debug/SmartCane_Monitoring.pdb and b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/bin/Debug/SmartCane_Monitoring.pdb differ diff --git a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index 2da341b..ba3b46f 100644 Binary files a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.csproj.FileListAbsolute.txt b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.csproj.FileListAbsolute.txt index 1d1ab7b..7f64fcc 100644 --- a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.csproj.FileListAbsolute.txt +++ b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.csproj.FileListAbsolute.txt @@ -7,3 +7,12 @@ C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\SmartCane_M C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\SmartCane_Monitoring\SmartCane_Monitoring\obj\Debug\SmartCane_Monitoring.exe C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\SmartCane_Monitoring\SmartCane_Monitoring\obj\Debug\SmartCane_Monitoring.pdb C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\SmartCane_Monitoring\SmartCane_Monitoring\obj\Debug\SmartCane_Monitoring.Form1.resources +C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\object classification by sound with k-nn algorithm\SmartCane_Monitoring\bin\Debug\SmartCane_Monitoring.exe.config +C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\object classification by sound with k-nn algorithm\SmartCane_Monitoring\obj\Debug\SmartCane_Monitoring.exe +C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\object classification by sound with k-nn algorithm\SmartCane_Monitoring\obj\Debug\SmartCane_Monitoring.pdb +C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\object classification by sound with k-nn algorithm\SmartCane_Monitoring\bin\Debug\SmartCane_Monitoring.exe +C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\object classification by sound with k-nn algorithm\SmartCane_Monitoring\bin\Debug\SmartCane_Monitoring.pdb +C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\object classification by sound with k-nn algorithm\SmartCane_Monitoring\obj\Debug\SmartCane_Monitoring.csprojResolveAssemblyReference.cache +C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\object classification by sound with k-nn algorithm\SmartCane_Monitoring\obj\Debug\SmartCane_Monitoring.Form1.resources +C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\object classification by sound with k-nn algorithm\SmartCane_Monitoring\obj\Debug\SmartCane_Monitoring.Properties.Resources.resources +C:\Users\wonsu\Documents\GitHub\MonitoringSensorData\soundMonitoring\object classification by sound with k-nn algorithm\SmartCane_Monitoring\obj\Debug\SmartCane_Monitoring.csproj.GenerateResource.Cache diff --git a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.csproj.GenerateResource.Cache b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.csproj.GenerateResource.Cache index dcaf203..32c5c9a 100644 Binary files a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.csproj.GenerateResource.Cache and b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.csproj.GenerateResource.Cache differ diff --git a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.exe b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.exe index 66ea890..36b8cee 100644 Binary files a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.exe and b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.exe differ diff --git a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.pdb b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.pdb index 21c3fc1..5e994b9 100644 Binary files a/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.pdb and b/Software/object classification by sound with k-nn algorithm/SmartCane_Monitoring/obj/Debug/SmartCane_Monitoring.pdb differ