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

  • SEARCH
  • Home
  • 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 8335579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:43:03+00:00 2026-06-09T03:43:03+00:00

I’m trying to make sure I understand my (digital) signal processing knowledge, by realizing

  • 0

I’m trying to make sure I understand my (digital) signal processing knowledge, by realizing a time-discrete version of a 1st order RC filter. (The background is that I’m trying to implement a PLL in software for SDR purposes, but this is a different story…)

My problem is that I thought I understood how to create the difference equation for such a filter, and therefore derive its coefficients. However when I plot the response in MATLAB using the freqz function – with the calculated a and b coefficients – I don’t get what looks like an RC filter response.

I referenced the Wikipedia page on this topic (at http://en.wikipedia.org/wiki/Low-pass_filter#Discrete-time_realization), just to make sure I wasn’t totally off in the weeds, but it still doesn’t help. This details the difference equation as:

yi = alpha * xi + ( 1 - alpha ) * yi-1
where: alpha = sample period / ( RC + sample period )

An example:

fs = 96000.0;                         % Sample rate.
delta_t = 1.0 / fs;                   % Sample period.
fc = 5000.0;                          % Filter cut off frequency.
tau = 1 / ( 2 * pi * fc );            % Time constant of filter.
alpha = delta_t / ( tau + delta_t );  % Smoothing factor per Wikipedia page.
b = [ alpha ];                        % 'b' coefficients
a = [ 1.0, ( 1 - alpha ) ];           % 'a' coefficents
freqz( b, a, 1024, fs );              % 1024 point FFT used.

The result:
enter image description here

Any thoughts as to where I’m going wrong? Have I totally misunderstood something?

Thanks in advance.

  • 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-06-09T03:43:04+00:00Added an answer on June 9, 2026 at 3:43 am

    You want your a(2) coefficient to be negative, since a represents the coefficient that appears on the left-hand side of the equation.

    a(1)*y(n) + a(2)*y(n-1) - ... + a(na+1)*y(n-na) = b(1)*x(n) + b(2)*x(n-1) + ... + b(nb+1)*x(n-nb)
    

    or equivalently,

    a = a ./ a(1)
    y(n) = b(1)*x(n) + b(2)*x(n-1) + ... + b(nb+1)*x(n-nb)
                     - a(2)*y(n-1) - ... - a(na+1)*y(n-na)
    

    See the documentation for filter


    With this correction, the response becomes

    enter image description here

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

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.