FIR filter implementation using ESP-DSP library

FIR filter implementation using ESP-DSP library

In this article we will implement an FIR filter using ESP-DSP library.

The C code is given as below.

#include <stdio.h>

#include "esp_dsp.h"

#include "dsps_fir.h"


#define INPUT_LEN 6

#define COEF_LEN 6

#define OUT_LEN 6


const float input_arr[]={1.0f,2.0f,3.0f,4.0f,1.0f,2.0f};

float output_arr[OUT_LEN] = {0};

float coef_arr[] = {1.0f,1.0f,1.0f,1.0f,1.0f,1.0f};

float delay_arr[COEF_LEN + 4]={0};


struct fir_f32_s var;


void app_main(void)

{

if(dsps_fir_init_f32(&var,coef_arr,delay_arr, COEF_LEN) == ESP_OK)//filter initialization


printf("filter initialized successfully\n");

}

else

{

printf("filter not initialized\n");

}



if(dsps_fir_f32_ae32(&var, input_arr,output_arr, OUT_LEN) == ESP_OK)//filter computation function

{

printf("filter computation success\n");

}

else

{

printf("filter computation not success\n");

}


for(int i=0;i<OUT_LEN;i++)

{


printf("%f\n",output_arr[i]);

}

}

Note :- The ESP-DSP library can be downloaded using following commands.

cd your-project-directory

mkdir -p components

cd components

git clone https://github.com/espressif/esp-dsp.git


That's it.




Development Environment - Espressif-IDE

Development Board - ESP32 WROOM

Programming language - C


要查看或添加评论,请登录

Satyabrata Senapati的更多文章

  • 7 Reasons Why Indian Startups Are Down: Challenges and Solutions

    7 Reasons Why Indian Startups Are Down: Challenges and Solutions

    India’s startup ecosystem has witnessed a remarkable surge in the last decade. From tech giants to homegrown…

  • Common Job Scams & Prevention (With Real Examples)

    Common Job Scams & Prevention (With Real Examples)

    The job search is one of the most vulnerable times in your life. During this time, you're actively looking for a new…

  • Resource management using counting semaphore

    Resource management using counting semaphore

    In this article we will discuss about counting semaphore in freertos. Counting semaphore can be used to control the…

  • Resource management using mutex

    Resource management using mutex

    In this article we will discuss about resource management using mutex. Resource management is an important and critical…

  • How I got a core embedded job by securing only 44.66% in 10th

    How I got a core embedded job by securing only 44.66% in 10th

    In this article we will discuss about my educational qualifications for getting a core job in embedded. Actually I was…

  • Salary of VLSI Engineer

    Salary of VLSI Engineer

    In this article we will discuss salary of a VLSI Engineer. The landscape of VLSI jobs offers positions that command…

  • ESP32 Timers & Timer Interrupt

    ESP32 Timers & Timer Interrupt

    In this article we will study how to use ESP32 internal Timers & generate Timer Interrupt events in Arduino IDE.We’ll…

  • OSEK(Open Systems and their Interfaces for the Electronics in Motor Vehicles)

    OSEK(Open Systems and their Interfaces for the Electronics in Motor Vehicles)

    OSEK (Offene Systeme und deren Schnittstellen für die Elektronik in Kraftfahrzeugen; English: "Open Systems and their…

  • AUTOSAR

    AUTOSAR

    This article will focus on AUTOSAR. AUTOSAR (AUTomotive Open System ARchitecture) is a global development partnership…

  • Embedded AI

    Embedded AI

    In this article we will discuss about Embedded AI. Embedded artificial intelligence (AI) seamlessly integrates AI into…