Thread: delay in filtered signals

Started: 2012-06-19 15:20:08
Last activity: 2012-06-20 00:16:30
Topics: SAC Help
Pablo.Palacios@bristol.ac.uk
2012-06-19 15:20:08
Hi,

I am using sac 101.4 (06/07/2010) on linux and 101.5c (02/01/2012) on mac
The following case occur in both versions.

The file attached shows a signal z(t) that was filtered three times with
bp co 5. According to the SAC manual the filter used is a Butterworth. It
definition has only a real component in frequency domain and non-shifted
signal is expected after use it. However, the plot attached shows the
cross-correlations between the original and its filtered signals, used up
to three times in series (a cascade filter). As is possible to see, each
filter is giving me a shifted signal, delays. At the bottom of the page,
the same data was filtered up to three times, with other program (R), with
the same Butterworth equation programmed by me.

Although the shift is small (few samples) in case to compute parallel or
series filter, this case could affect the results.

So, my question is if actually sac is using a Butterworth filter, or
another. Or if this is a bug.

Best wishes,
Pablo


--

Attachments
  • Fiona Darbyshire
    2012-06-19 18:44:02
    Hi,

    I don't count myself as an expert, but one thing to check is the
    number of passes in the filter command you are using. If you just do
    "lp co 5" you will get a Butterworth filter that gives a small
    phase-shift, which would translate into the time-shift you observe. To
    get a zero-phase filter, you need "lp co 5 p 2" i.e. 2 passes per
    application of the filter.

    Hope that helps; if you are already using "p 2" then there must be a
    different problem, and someone else will have to advise.

    Fiona Darbyshire.


    On Tue, Jun 19, 2012 at 3:20 AM, <Pablo.Palacios<at>bristol.ac.uk> wrote:
    Hi,

    I am using sac 101.4 (06/07/2010) on linux and 101.5c (02/01/2012) on mac
    The following case occur in both versions.

    The file attached shows a signal z(t) that was filtered three times with
    bp co 5. According to the SAC manual the filter used is a Butterworth. It
    definition has only a real component in frequency domain and non-shifted
    signal is expected after use it. However, the plot attached shows the
    cross-correlations between the original and its filtered signals, used up
    to three times in series (a cascade filter). As is possible to see, each
    filter is giving me a shifted signal, delays. At the bottom of the page,
    the same data was filtered up to three times, with other program (R), with
    the same Butterworth equation programmed by me.

    Although the shift is small (few samples) in case to compute parallel or
    series filter, this case could affect the results.

    So, my question is if actually sac is using a Butterworth filter, or
    another. Or if this is a bug.

    Best wishes,
    Pablo


    --

    _______________________________________________
    sac-help mailing list
    sac-help<at>iris.washington.edu
    http://www.iris.washington.edu/mailman/listinfo/sac-help


    • Pablo.Palacios@bristol.ac.uk
      2012-06-20 00:16:30
      Thanks a lot Fiona,
      Its works well!
      P.

      On Tue, June 19, 2012 4:44 pm, Fiona Darbyshire wrote:
      Hi,

      I don't count myself as an expert, but one thing to check is the
      number of passes in the filter command you are using. If you just do
      "lp co 5" you will get a Butterworth filter that gives a small
      phase-shift, which would translate into the time-shift you observe. To
      get a zero-phase filter, you need "lp co 5 p 2" i.e. 2 passes per
      application of the filter.

      Hope that helps; if you are already using "p 2" then there must be a
      different problem, and someone else will have to advise.

      Fiona Darbyshire.


      On Tue, Jun 19, 2012 at 3:20 AM, <Pablo.Palacios<at>bristol.ac.uk> wrote:
      Hi,

      I am using sac 101.4 (06/07/2010) on linux and 101.5c (02/01/2012) on
      mac
      The following case occur in both versions.

      The file attached shows a signal z(t) that was filtered three times with
      bp co 5. According to the SAC manual the filter used is a Butterworth.
      It
      definition has only a real component in frequency domain and non-shifted
      signal is expected after use it. However, the plot attached shows the
      cross-correlations between the original and its filtered signals, used
      up
      to three times in series (a cascade filter). As is possible to see, each
      filter is giving me a shifted signal, delays. At the bottom of the page,
      the same data was filtered up to three times, with other program (R),
      with
      the same Butterworth equation programmed by me.

      Although the shift is small (few samples) in case to compute parallel or
      series filter, this case could affect the results.

      So, my question is if actually sac is using a Butterworth filter, or
      another. Or if this is a bug.

      Best wishes,
      Pablo


      --

      _______________________________________________
      sac-help mailing list
      sac-help<at>iris.washington.edu
      http://www.iris.washington.edu/mailman/listinfo/sac-help




      --



      • Arthur Snoke
        2012-06-19 21:00:36
        It sounds like things are working and it is not a SAC bug. However, the
        LP help file is fairly terse. It references you to the BANDPASS help file
        for more details about the options, such as what happens when one does a
        "passes 2" option. Also perhaps of interest is that when one does a
        "passes 2" option, the number of poles is effectively doubled as the same
        filter is run twice, just reversing the phase the second time.
        http://www.iris.edu/software/sac/commands/bandpass.html

        As Fiona mentioned, there is a phase shift accompanying the causal filter
        that leads to a time delay. In my non-SAC filter programs, I accompany a
        low-pass filter with a time shift. I have not tried to do a time shift
        within SAC -- and am not sure if one can. If it can be done, please
        "remind" me.

        Arthur

        On Tue, 19 Jun 2012, Pablo.Palacios<at>bristol.ac.uk wrote:

        Thanks a lot Fiona,
        Its works well!
        P.

        On Tue, June 19, 2012 4:44 pm, Fiona Darbyshire wrote:
        Hi,

        I don't count myself as an expert, but one thing to check is the
        number of passes in the filter command you are using. If you just do
        "lp co 5" you will get a Butterworth filter that gives a small
        phase-shift, which would translate into the time-shift you observe. To
        get a zero-phase filter, you need "lp co 5 p 2" i.e. 2 passes per
        application of the filter.

        Hope that helps; if you are already using "p 2" then there must be a
        different problem, and someone else will have to advise.

        Fiona Darbyshire.


        On Tue, Jun 19, 2012 at 3:20 AM, <Pablo.Palacios<at>bristol.ac.uk> wrote:
        Hi,

        I am using sac 101.4 (06/07/2010) on linux and 101.5c (02/01/2012) on
        mac
        The following case occur in both versions.

        The file attached shows a signal z(t) that was filtered three times with
        bp co 5. According to the SAC manual the filter used is a Butterworth.
        It
        definition has only a real component in frequency domain and non-shifted
        signal is expected after use it. However, the plot attached shows the
        cross-correlations between the original and its filtered signals, used
        up
        to three times in series (a cascade filter). As is possible to see, each
        filter is giving me a shifted signal, delays. At the bottom of the page,
        the same data was filtered up to three times, with other program (R),
        with
        the same Butterworth equation programmed by me.

        Although the shift is small (few samples) in case to compute parallel or
        series filter, this case could affect the results.

        So, my question is if actually sac is using a Butterworth filter, or
        another. Or if this is a bug.

        Best wishes,
        Pablo


        --

        _______________________________________________
        sac-help mailing list
        sac-help<at>iris.washington.edu
        http://www.iris.washington.edu/mailman/listinfo/sac-help




        --


        _______________________________________________
        sac-help mailing list
        sac-help<at>iris.washington.edu
        http://www.iris.washington.edu/mailman/listinfo/sac-help


01:17:21 v.01697673