frequency

Get sound frequency with Android FFT

北城余情 提交于 2019-11-30 15:58:47
The following code just shows a graph, but I want the sound's frequency. I am trying to record voice and get real-time frequency, so that I can play a piano or guitar sound and find the frequency. public class AudioProcessing extends Activity implements OnClickListener { int frequency = 8000; int channelConfiguration = AudioFormat.CHANNEL_CONFIGURATION_MONO; int audioEncoding = AudioFormat.ENCODING_PCM_16BIT; private RealDoubleFFT transformer; int blockSize = 256; Button startStopButton; boolean started = false; RecordAudio recordTask; ImageView imageView; Bitmap bitmap; Canvas canvas; Paint

Android audio FFT to display fundamental frequency

南楼画角 提交于 2019-11-30 14:19:11
问题 I have been working on an Android project for awhile that displays the fundamental frequency of an input signal (to act as a tuner). I have successfully implemented the AudioRecord class and am getting data from it. However, I am having a hard time performing an FFT on this data to get the fundamental frequency of the input signal. I have been looking at the post here, and am using FFT in Java and Complex class to go with it. I have successfully used the FFT function found in FFT in Java, but

android getting sound frequencies real time?

↘锁芯ラ 提交于 2019-11-30 11:05:06
问题 I have been trying to get the sound frequency(number) in real time using fft and i am having run time errors. can any one help? package com.example.recordsound; import edu.emory.mathcs.jtransforms.fft.DoubleFFT_1D; import ca.uol.aig.fftpack.RealDoubleFFT; public class MainActivity extends Activity implements OnClickListener{ int audioSource = MediaRecorder.AudioSource.MIC; // Audio source is the device MIC int channelConfig = AudioFormat.CHANNEL_IN_MONO; // Recording in mono int audioEncoding

How to use dplyr to generate a frequency table

孤人 提交于 2019-11-30 11:04:05
I like to create a table that has the frequency of several columns in my data frame. I am copying part of my data frame below. The table is supposed to have frequency (both n and %) of "red" in Color and "F" in Gender. I think that the dplyr package could do this but I cannot figure it out. Thank you- RespondentID Color Gender 1 1503 Red F 2 1653 NA M 3 1982 Red F 4 4862 Red NA 15 4880 Blue M library(dplyr) df %>% count(Color, Gender) %>% group_by(Color) %>% # now required with changes to dplyr::count() mutate(prop = prop.table(n)) # Source: local data frame [4 x 4] # Groups: Color [3] # #

Android audio FFT to display fundamental frequency

做~自己de王妃 提交于 2019-11-30 10:19:20
I have been working on an Android project for awhile that displays the fundamental frequency of an input signal (to act as a tuner). I have successfully implemented the AudioRecord class and am getting data from it. However, I am having a hard time performing an FFT on this data to get the fundamental frequency of the input signal. I have been looking at the post here , and am using FFT in Java and Complex class to go with it. I have successfully used the FFT function found in FFT in Java, but I am not sure if I am obtaining the correct results. For the magnitude of the FFT (sqrt[re re+im im])

Count appearances of a value until it changes to another value

佐手、 提交于 2019-11-30 08:32:59
问题 I have the following DataFrame: df = pd.DataFrame([10, 10, 23, 23, 9, 9, 9, 10, 10, 10, 10, 12], columns=['values']) I want to calculate the frequency of each value, but not an overall count - the count of each value until it changes to another value. I tried: df['values'].value_counts() but it gives me 10 6 9 3 23 2 12 1 The desired output is 10:2 23:2 9:3 10:4 12:1 How can I do this? 回答1: Use: df = df.groupby(df['values'].ne(df['values'].shift()).cumsum())['values'].value_counts() Or: df =

MATLAB - Missing fundamental from an FFT [closed]

南笙酒味 提交于 2019-11-30 07:03:32
I am currently working on my fourth year project (computer science) which involves the automatic transcription of music -> sheet music. I am doing it in Matlab at the moment but will have to be converted to java at some stage. My problem: I have my program returning the correct notes for pure sine tones, I have now encountered a problem when it comes to the retrieval of the fundamental frequency from a note played by a natural instrument. With certain notes, the peak representing the fundamental of the note seems to be missing entirely. For example when I play a G3 note from garageband, it is

Counting phrase frequency in Python 3.3.2

ε祈祈猫儿з 提交于 2019-11-30 05:03:17
问题 I have been examining different sources on the web and have tried various methods but could only find how to count the frequency of unique words but not unique phrases. The code I have so far is as follows: import collections import re wanted = set(['inflation', 'gold', 'bank']) cnt = collections.Counter() words = re.findall('\w+', open('02.2003.BenBernanke.txt').read().lower()) for word in words: if word in wanted: cnt [word] += 1 print (cnt) If possible, I would also like to count the

Java equivalent of C# system.beep?

断了今生、忘了曾经 提交于 2019-11-30 00:57:40
问题 I am working on a Java program, and I really need to be able to play a sound by a certain frequency and duration, similarly to the c# method System.Beep, I know how to use it in C#, but I can't find a way to do this in Java. Is there some equivalent, or another way to do this? using System; class Program { static void Main() { // The official music of Dot Net Perls. for (int i = 37; i <= 32767; i += 200) { Console.Beep(i, 100); } } } 回答1: I don't think there's a way to play tunes 1 with "beep

Get sound frequency with Android FFT

删除回忆录丶 提交于 2019-11-29 23:12:49
问题 The following code just shows a graph, but I want the sound's frequency. I am trying to record voice and get real-time frequency, so that I can play a piano or guitar sound and find the frequency. public class AudioProcessing extends Activity implements OnClickListener { int frequency = 8000; int channelConfiguration = AudioFormat.CHANNEL_CONFIGURATION_MONO; int audioEncoding = AudioFormat.ENCODING_PCM_16BIT; private RealDoubleFFT transformer; int blockSize = 256; Button startStopButton;