paramsen / noise Goto Github PK
View Code? Open in Web Editor NEWNoise is an Android wrapper for kissfft, a FFT implementation written in C.
License: Apache License 2.0
Noise is an Android wrapper for kissfft, a FFT implementation written in C.
License: Apache License 2.0
Hi, How do I get an Authentication to clone the git repo into my desktop?
Because i'm getting this error "Authentication failed. You may not have permission to access the repository or the repository may have been archived."
Since the AudioRecord uses AudioFormat.ENCODING_PCM_16BIT
, the range of the recorded floats are Short.MIN_VALUE
..Short.MAX_VALUE
.
Then in MainActivity
, the energy values are doubled before applying the FFT. (I'm also curious about the reason for doubling them.)
I would therefore expect the max magnitude to be
val maxConst = (2.0 * Short.MIN_VALUE).pow(2.0) + (2.0 * Short.MAX_VALUE).pow(2.0)
which evaluates to very close to exactly 8 times bigger than what you have.
How did you come up with the value 175M? Clearly there's a problem in my reasoning, because it looks correct with 175M.
Hello,
This is not really an issue, but rather a question about how to use your library.
We are trying to use your library to compute power spectral density on a live audio signal in an Android app. We want results per octave band, or per โ
octave band.
Currently we have to following Kotlin code for the octave band version. We adapted this from the code that drives the bottom graph in your demo app.
package com.paramsen.noise
import kotlin.math.log10
class SoundSpectrumUtils {
companion object {
private const val bands = 11
private val lbands: Array<Int> = arrayOf(11, 22, 44, 88, 177, 355, 710, 1420, 2840, 5680, 11360);
private val ubands = arrayOf(22, 44, 88, 177, 355, 710, 1420, 2840, 5680, 11360, 22050);
private val bandSizes = IntArray(bands) { i -> ubands[i] - lbands[i] }
@JvmStatic
fun calculateBands(samples: FloatArray): FloatArray {
val noise = Noise.real(samples.size)
// not sure why this is, but it's in the sample app, see also https://github.com/paramsen/noise/issues/6
for (i in samples.indices) {
samples[i] *= 2.0f
}
val fft = noise.fft(samples, FloatArray(samples.size + 2))
val resultFFT = FloatArray(samples.size);
System.arraycopy(fft, 2, resultFFT, 0, fft.size - 2)
val resultBands = FloatArray(bands);
for (i in 0 until bands) {
var accum = .0f
for (j in 0 until bandSizes[i] step 2) {
//convert real and imag part to get energy
accum += (Math.pow(
resultFFT[j + lbands[i]].toDouble(),
2.0
) + Math.pow(resultFFT[j + 1 + lbands[i]].toDouble(), 2.0)).toFloat()
}
accum /= bandSizes[i] / 2
accum = 10 * log10(accum)
resultBands[i] = accum;
}
return resultBands;
}
}
}
We have following challenges with this:
Thanks in advance for any pointers you might be able to give.
I downloaded your project and compile
CMake Error at CMakeLists.txt:3 (add_library):
Cannot find source file:
src/main/native/kissfft/kiss_fft.c
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
in the readme for the imaginary input sample, I think the code should read:
Noise noise = Noise.imaginary()
When i go to next page help of replace fragment and then i go to back wave disappear.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.