Git Product home page Git Product logo

noise's People

Contributors

dakeks avatar paramsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

noise's Issues

Authentication failed

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."

Show calculation of the magic number in FFTBandView

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.

Spectral analysis

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.

Build error

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

imaginary sample

in the readme for the imaginary input sample, I think the code should read:

Noise noise = Noise.imaginary()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.