저는 Superpowered SDK를 이해하려고하지만 Android 및 C++ 및 오디오 신호를 처음 사용하는 것은 이해하려고합니다. 여기에 주파수 도메인 예가 나와 있습니다. https://github.com/superpoweredSDK/Low-Latency-Android-Audio-iOS-Audio-Engine/tree/master/Examples_Android/FrequencyDomainAndroid SuperPowered SDK 오디오 - 주파수 도메인 예제 - memset 주파수 조작
내 Nexus 5X에서 실행 중입니다. FrequencyDomain.cpp 파일에서 :
static SuperpoweredFrequencyDomain *frequencyDomain;
static float *magnitudeLeft, *magnitudeRight, *phaseLeft, *phaseRight, *fifoOutput, *inputBufferFloat;
static int fifoOutputFirstSample, fifoOutputLastSample, stepSize, fifoCapacity;
#define FFT_LOG_SIZE 11 // 2^11 = 2048
static bool audioProcessing(void * __unused clientdata, short int *audioInputOutput, int numberOfSamples, int __unused samplerate) {
SuperpoweredShortIntToFloat(audioInputOutput, inputBufferFloat, (unsigned int)numberOfSamples); // Converting the 16-bit integer samples to 32-bit floating point.
frequencyDomain->addInput(inputBufferFloat, numberOfSamples); // Input goes to the frequency domain.
// In the frequency domain we are working with 1024 magnitudes and phases for every channel (left, right), if the fft size is 2048.
while (frequencyDomain->timeDomainToFrequencyDomain(magnitudeLeft, magnitudeRight, phaseLeft, phaseRight)) {
// You can work with frequency domain data from this point.
// This is just a quick example: we remove the magnitude of the first 20 bins, meaning total bass cut between 0-430 Hz.
memset(magnitudeLeft, 0, 80);
memset(magnitudeRight, 0, 80);
나는 처음 20 개 쓰레기통 0-430 Hz에서 여기에서 얼마나 이해 : How do I obtain the frequencies of each value in an FFT?
하지만 난 memset 함수 80의 가치를 이해하지 ... 4 * 20 일 때, float * 20 bins의 경우 4 바이트입니까? magnitudeLeft는 모든 주파수에 대한 데이터를 보유합니까? 그런 다음 어떻게하면 중간에서 최고 10 개 주파수를 제거 할 수 있습니까? 고맙습니다!