⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 amf_testgennoisewhite.c

📁 ADI SHARC DSP 音频算法标准模块库
💻 C
字号:
// Copyright(c) 2005 Analog Devices, Inc. All Rights Reserved.
// This software is proprietary and confidential to Analog Devices, Inc. and its licensors.

// File    : $Id: //depot/development/visualaudio/modules/2.5.0/SHARC/Source/AMF_TestGenNoiseWhite.c#3 $ 
// Part of : VisualAudio V2.5.0 
// Updated : $Date: 2006/10/12 $ by $Author: Fernando $



#include "AMF_TestGenNoiseWhite.h"
#include <stdlib.h>

void AMF_TestGenNoiseWhite_Render(AMF_TestGenNoiseWhite * restrict instance,float * restrict * buffers,int tickSize);

SEG_MOD_FAST_CODE  void AMF_TestGenNoiseWhite_Render(AMF_TestGenNoiseWhite * restrict instance,float * restrict * buffers,int tickSize) {
    int i;
    float *out = buffers[0];
    int seed;    
    int tmp;
    float scale = instance->scale;

    srand(instance->seed);
    
    for (i=0; i<tickSize; i++) {
        tmp = rand();
        // scale and offset to be in range -1.0 to 1.0
        out[i]=(tmp - (RAND_MAX/2))*(scale*2.0f/RAND_MAX);
    }
    instance->seed = tmp;
}

SEG_MOD_SLOW_CONST const AMF_ModuleClass AMFClassTestGenNoiseWhite = {
    
    /* Flags */
    0,
     
    /* Render function */
    (AMF_RenderFunction)AMF_TestGenNoiseWhite_Render,

    /* Default bypass */
    (void *)0,
    
    /* Input descriptor - no inputs. */
    0, 0,

    /* Output descriptor - 1 output, and it is mono. */
    1, 0,
};


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -