frequency-analysis

Frequency analysis issues with tuple error

拈花ヽ惹草 提交于 2020-01-06 15:51:28
问题 In the match_letters function, with 'place = string.index(letter)' i keep recieving the same error of 'Value Error: tuple.index(x): x not a tuple.' Does anyone know how to solve this? It will be much appreciated :) Thanks def freq_analysis(): """ Summary: Perform a frequency analysis on a string Paramaters: text - The text to analyse Returns: A string containing the deciphered text """ text = input("enter text") letterCount = getLetterCount(text) Letter_Count_Tuple,new_letter_count,descending

Frequency analysis issues with tuple error

本秂侑毒 提交于 2020-01-06 15:51:11
问题 In the match_letters function, with 'place = string.index(letter)' i keep recieving the same error of 'Value Error: tuple.index(x): x not a tuple.' Does anyone know how to solve this? It will be much appreciated :) Thanks def freq_analysis(): """ Summary: Perform a frequency analysis on a string Paramaters: text - The text to analyse Returns: A string containing the deciphered text """ text = input("enter text") letterCount = getLetterCount(text) Letter_Count_Tuple,new_letter_count,descending

FFT guitar tuner application - incorrect frequency

放肆的年华 提交于 2019-12-25 06:04:51
问题 I have been working on a guitar tuner application. I understand that the FFT is a bad choice for this kind of application. However, as deadlines get ever closer, and my original specification submission specified use of this algorithm. So unfortunately I am stuck with it. Thanks to answers to previous questions and use of this blog: http://blog.bjornroche.com/2012/07/frequency-detection-using-fft-aka-pitch.html I have an application that takes in audio, calculates the frequency and both

Word frequency count based on two words using python

南笙酒味 提交于 2019-12-25 04:32:16
问题 There are many resources online that shows how to do a word count for single word like this and this and this and others... But I was not not able to find a concrete example for two words count frequency . I have a csv file that has some strings in it. FileList = "I love TV show makes me happy, I love also comedy show makes me feel like flying" So I want the output to be like : wordscount = {"I love": 2, "show makes": 2, "makes me" : 2 } Of course I will have to strip all the comma,

Word Frequency in text using Python but disregard stop words

天大地大妈咪最大 提交于 2019-12-23 11:57:18
问题 This gives me a frequency of words in a text: fullWords = re.findall(r'\w+', allText) d = defaultdict(int) for word in fullWords : d[word] += 1 finalFreq = sorted(d.iteritems(), key = operator.itemgetter(1), reverse=True) self.response.out.write(finalFreq) This also gives me useless words like "the" "an" "a" My question is, is there a stop words library available in python which can remove all these common words? I want to run this on google app engine 回答1: You can download lists of stopwords

Android app to record sound in real time and identify frequency

ぐ巨炮叔叔 提交于 2019-12-21 20:51:42
问题 I need to develop an app to record frequencies in real time using the phone's mic and then display them (in text). I am posting my code here. The FFT and complex classes have been used from http://introcs.cs.princeton.edu/java/97data/FFT.java.html and http://introcs.cs.princeton.edu/java/97data/Complex.java.html .The problem is when i run this on the emulator the frequency starts from some random value and keeps on increasing till 7996. It then repeats the whole process. Can someone plz help

FFT pitch detection for guitar string

房东的猫 提交于 2019-12-21 20:40:04
问题 I have simply pitch detection. Input (microphone) data are passed to fft routine, then I'm looking for a pitch with maximum value It means: Max(pow(data[i].getRe(), 2) + pow(data[i].getIm(), 2)) for 0<= i < SAmplesSize I need it for detection of guitar string's primary frequency. It works well for freq 440 hz (and maybe higher, i didn't check that) downto 250 hz. Below this value detected frequency is twice as high as it should be, ie. for 195 hz detected frequency is about 380 hz. It looks

How to extract a specific frequency range from a .wav file?

跟風遠走 提交于 2019-12-21 18:05:33
问题 I'm really new on sound processing, so maybe my question will be trivial. What I want to do is to extract a specific frequency range (let's say 150-400 Hz) from a wav file, using R. In other words, I want to create another wave file (wave2) that contains only the frequency component that I specify (150 to 400 Hz, or what else). I read something on the net, and I discovered out that this can be done with a FFT analysis, and here's come the problems. Suppose I've this code: library(sound) s1 <-

Awk: Words frequency from one text file, how to ouput into myFile.txt?

只愿长相守 提交于 2019-12-20 05:10:34
问题 Given a .txt files with space separated words such as: But where is Esope the holly Bastard But where is And the Awk function : cat /pathway/to/your/file.txt | tr ' ' '\n' | sort | uniq -c | awk '{print $2"@"$1}' I get the following output in my console : 1 Bastard 1 Esope 1 holly 1 the 2 But 2 is 2 where How to get into printed into myFile.txt ? I actually have 300.000 lines and near 2 millions words. Better to output the result into a file. EDIT: Used answer (by @Sudo_O): $ awk '{a[$1]++

How to calculate sound frequency in android?

假如想象 提交于 2019-12-18 10:17:46
问题 I want to develop app to calculate Sound frequency in Android. Android Device will take Sound from microphone (i.e. out side sound) and I have one color background screen in app. on sound frequency changes i have to change background color of screen . So my question is "How can i get sound frequency"? is there any android API available? Please help me out of this problem. 回答1: Your problem was solved here EDIT: archived here. Also you can analyze the frequency by using FFT. EDIT: