Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6003995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:12:00+00:00 2026-05-23T01:12:00+00:00

I want to make a FIR filter using a window function. I have some

  • 0

I want to make a FIR filter using a window function. I have some sample data and size variable is a count of samples. The windowSize variable is a size of the window function.
At first I create the window function (blackman window): the variable window
Then I need to multiply it by sin(x) / x function and convolve with real data (variable data):

for (int i = 0; i < size; ++i) {
for (j = 0; j < windowSize; ++j) {
    double arg = 2.0 * PI * ((double)j - (double)windowSize / 2.0) / (double)windowSize;
    if (i + j - windowSize / 2 < 0)
       continue;
    if (arg == 0) {
    filteredData[i] += data[i + j - windowSize / 2] * window[j] * 1.0 /  (double)windowSize;
    } else
        filteredData[i] += data[i + j - windowSize / 2] * window[j] * (sin(arg) / arg) / (double)windowSize;
    }
}

The problem:

  1. As a result I get a filtered data with an average which very different than the average of the original data. Where is a mistake?

  2. In the DSP book it is written that in order to make a FIR filter we should multiply the function sin(x) / x by a window function and then perform the convolution, but nothing is written about x in the sin(x) / x, so I used the:

    double arg = 2.0 * PI * ((double)j – (double)windowSize / 2.0) / (double)windowSize;

for the x value, the argument of sine, is it correct?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:12:01+00:00Added an answer on May 23, 2026 at 1:12 am

    The sin(x)/x filter is a lowpass filter. That is, it suppresses all frequencies above a certain cutoff frequency.

    If the sampling frequency is Fs (Hertz) and you want a cutoff frequency of fc (Hertz), You should be using x = 2*PI*fc/(2*Fs)*n where n goes from -N to +N and N is large enough that the sin(x)/x function is close to zero. Don’t forget that sin(x)/x is 1 when x is zero.

    To maintain the average of the signal you have to normalize the filter coefficients by their sum. I.e., set f_norm[k] = f[k] / sum(f[k], k=…)

    That’s all I have to say at this point. It seems like you have a lot to learn. I suggest a good book on signal processing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want make function like that function(data){ } i want this data as this
I want to make sure that a set of functions have the same signature
I want to make a login system using ASP.NET (MVC). On the internet, I
I want make datetimepicker in my project. Using jquery how it is possible? I
I want to make some graphical dialogs for my script but don't know how.
I want to make a class serializable but i dont want make serializable some
i have 2 line want make it one line and do the same job
Let's say I want make some of my sources publicly available via my blog
i have the different image with the different size too, i want to put
I have a project and I want make smart pointers usage better. The main

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.