iris-edu / stationxml-validator

GNU General Public License v3.0
16 stars 8 forks source link

FIR filter should have input and output units as COUNT #126

Open crotwell opened 3 years ago

crotwell commented 3 years ago

Proposed rule. FIR filters, in Stage, are inherently digital, so the input and output units must be COUNT.

metempleton commented 3 years ago

Good Morning Philip,

ADC and FIR Decimation stages are most often represented as 
in stationXML and input units to the ADC stage are Volts. If by FIR filters you mean , I don’t think this rule will work… But maybe I’m missing something? My $.02, Mary > On Sep 30, 2020, at 7:24 PM, Philip Crotwell wrote: > > > Proposed rule. FIR filters, in Stage, are inherently digital, so the input and output units must be COUNT. > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub, or unsubscribe. >
crotwell commented 3 years ago

Yes, I mean the actual <FIR> element in stationxml, which if I read the docs correctly has to be a digital FIR filter. I guess it is not often used, which is unfortunate as it feels more appropriate than Coefficients in the case of an actual FIR filter.

Response: FIR filter. Corresponds to SEED blockette 61. FIR filters are also commonly documented using the CoefficientsType element.

I have long thought that using a Coefficients with no values as a placeholder in the ADC stage is wrong, but...

Issue about it is here

metempleton commented 3 years ago

Thanks for the clarification.

I don’t like the 0 coefficients convention for the ADC either. (I always use 1 coeff with value 1.)

—Mary

On Oct 1, 2020, at 8:50 AM, Philip Crotwell notifications@github.com wrote:

Yes, I mean the actual element in stationxml, which if I read the docs correctly has to be a digital FIR filter. I guess it is not often used, which is unfortunate as it feels more appropriate than Coefficients in the case of an actual FIR filter.

Response: FIR filter. Corresponds to SEED blockette 61. FIR filters are also commonly documented using the CoefficientsType element.

I have long thought that using a Coefficients with no values as a placeholder in the ADC stage is wrong, but...

Issue about it is here

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

timronan commented 3 years ago

Blockette 61 in the SEED manual states "The FIR blockette is used to specify FIR (Finite Impulse Response) digital filter coefficients." (SEED Manual Pg. 82). This rule would be consistent with issue #112's rule 406.

I think the rule should read something similar to:

417| IF Stage[N]:FIR is included then Stage[N]:InputUnits:Name and Stage[N]:OutputUnits:Name must equal count| C1 | C2

Does that seems to cover this rule proposal?

crotwell commented 3 years ago

That looks good to me.

timronan commented 3 years ago

I looking at the SEED manual appendix C and going back over this rule, and I want to make sure that I am understanding it correctly. Why can't a FIR filter [B61] be used for an ADC? It seems like the input units for the FIR filter could be volts and the output units could be counts.

crotwell commented 3 years ago

Humm, you may be right. It isn't that the FIR filter can have input units of v, FIR filters must be all digital, but the way SEED does responses is, how shall I say, somewhere between wrong and confusing. Stages are ordered, but there isn't a huge amount of guidance about the order of say an AtoD, a FIR filter, a gain and a decimation within a single stage. Ideally, if I were designing the response chain, each stage would only do one thing at a time. But if you think of the AtoD as being the first thing in the stage, before the FIR, then your worry is probably justified.

For sure the output units should be counts, but it may be fine to have the input units be whatever if the FIR is part of a AtoD stage.

Maybe Mary has useful thoughts...

metempleton commented 3 years ago

I’m not sure how useful this will be, but the only two networks that I’m familiar with who use FIR blockettes/elements are CI and BK. Both use Coefficients for the ADC and switch to FIR for decimation stages.

I see that the SEED manual says it is acceptable but discouraged to combine the ADC stage into the first FIR filter. There is a draft stationXML manual in the works and I don’t see any specific guidance on how to represent the ADC stage. I don’t know how much this document will change before it’s finalized. That’s everything I know…

cheers, Mary

On Oct 6, 2020, at 7:01 PM, Philip Crotwell notifications@github.com wrote:

Humm, you may be right. It isn't that the FIR filter can have input units of v, FIR filters must be all digital, but the way SEED does responses is, how shall I say, somewhere between wrong and confusing. Stages are ordered, but there isn't a huge amount of guidance about the order of say an AtoD, a FIR filter, a gain and a decimation within a single stage. Ideally, if I were designing the response chain, each stage would only do one thing at a time. But if you think of the AtoD as being the first thing in the stage, before the FIR, then your worry is probably justified.

For sure the output units should be counts, but it may be fine to have the input units be whatever if the FIR is part of a AtoD stage.

Maybe Mary has useful thoughts...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

timronan commented 3 years ago

In SEED or StationXML there can't be both an AtoD [B54] and FIR [B61] in one stage. Each of these is a separate stage containing it's own unit Decimation [B57] and Gain [B58]. I was thinking that an AtoD could be defined by an FIR[B61] Decimation [B57] and Gain [B58], but I think that I was incorrect.

I just reread page 160 of the SEED manual and it states that an AtoD stage should be defined as a Coefficient [B54] Decimation [B57] and Gain [B58]. The notes above and the SEED manual seems to states that FIR [B61] stages are digital filters so input and output units probably should be count.

metempleton commented 3 years ago

On Oct 7, 2020, at 9:50 AM, timronan notifications@github.com wrote:

In SEED or StationXML there can't be both an AtoD [B54] and FIR [B61] in one stage. Each of these is a separate stage containing it's own unit Decimation [B57] and Gain [B58]. I was thinking that an AtoD could be defined by an FIR[B61] Decimation [B57] and Gain [B58], but I think that I was incorrect.

You’re right, there wouldn’t be 2 elements that describe coefficients in the same stage. When I see this (more often than you’d think), the ADC and first FIR are combined into a single stage where the Coefficients and Decimation elements describe the FIR filter, the Gain describes the ADC scale factor. If someone did this with a FIR element, I suspect you’d just see a FIR element and no Coefficient element.

I just reread page 160 of the SEED manual and it states that an AtoD stage should be defined as a Coefficient [B54] Decimation [B57] and Gain [B58]. The notes above and the SEED manual seems to states that FIR [B61] stages are digital filters so input and output units probably should be count.

Because of the next paragraph in the SEED manual:

"Note that it is acceptable (but discouraged) to combine the digitizer description with the first FIR stage. In this case, the input units would be volts and the output units would be counts.”

guidance on using B61 this way seems ambiguous to me. I think you could argue either way, and I like the idea of keeping B61 strictly digital. I think we need to clarify guidance on this in the new stationXML manual.

—mt

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

timronan commented 3 years ago

It would be good to eliminate the ambiguity with this issue, and making B61 strictly be digital seems like a good option. Thanks for the clarification.

crotwell commented 3 years ago

@metempleton do you want to file an issue on the new stationxml docs to clarify this?

metempleton commented 3 years ago

Let me run that by Chad to get his thoughts before committing. The questions I have are whether we can still request changes to the doc and what the scope of a request like that would be in the end, given that there is little specific guidance on which elements to use for various stages. But I will follow up and keep everyone in the loop.

—Mary

On Oct 7, 2020, at 10:38 AM, Philip Crotwell notifications@github.com wrote:

@metempleton do you want to file an issue on the new stationxml docs to clarify this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

crotwell commented 3 years ago

OK, but even if it can't be added to the current, filing an issue so it can be addressed in the next stationxml revision would be good. Issue trackers remember, people often forget! :)