Introduction
Introduction Statistics Contact Development Disclaimer Help
Find more tones - warvox - VoIP based wardialing tool, forked from rapid7/warvo…
Log
Files
Refs
README
---
commit fd2263f9d39b5c2b7ae0982962982492e212eac0
parent ef8638d44b9365d3f3f3f841ccf950f676d48d36
Author: HD Moore <[email protected]>
Date: Sun, 22 Feb 2009 20:08:34 +0000
Find more tones
Diffstat:
M bin/search_tones.rb | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
---
diff --git a/bin/search_tones.rb b/bin/search_tones.rb
@@ -23,23 +23,18 @@ end
raw = WarVOX::Audio::Raw.from_file(ARGV.shift || usage)
min = (ARGV.shift || 1).to_f
-res = KissFFT.fftr(4096, 8000, 1, raw.samples)
+res = KissFFT.fftr(8192, 8000, 1, raw.samples)
tones = {}
res.each do |x|
- mf = 0
- mp = 0
- x.each do |o|
- if(o[1] > mp)
- mp = o[1]
- mf = o[0]
- end
+ rank = x.sort{|a,b| a[1].to_i <=> b[1].to_i }.reverse
+ rank[0..10].each do |t|
+ f = t[0].round
+ p = t[1].round
+ next if f == 0
+ tones[ f ] ||= []
+ tones[ f ] << t
end
- if(mp > min)
- tones[mf.to_i] ||= []
- tones[mf.to_i] << [mf, mp]
- end
- # puts "#{mf.to_i}hz @ #{mp.to_i}"
end
tones.keys.sort.each do |t|
You are viewing proxied material from jay.scot. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.