Calculate the `signal`'s Sound Pressure Level The calculations are made by frequency bands and ranges from `minFreq` to `maxFreq` with `nthOct` bands per octave. Returns ------- Analysis: The sound pressure level packed into an Analysis object.
(signal, nthOct=3, minFreq=100, maxFreq=4000)
| 122 | |
| 123 | |
| 124 | def SPL(signal, nthOct=3, minFreq=100, maxFreq=4000): |
| 125 | """ |
| 126 | Calculate the `signal`'s Sound Pressure Level |
| 127 | |
| 128 | The calculations are made by frequency bands and ranges from `minFreq` to |
| 129 | `maxFreq` with `nthOct` bands per octave. |
| 130 | |
| 131 | Returns |
| 132 | ------- |
| 133 | Analysis: The sound pressure level packed into an Analysis object. |
| 134 | |
| 135 | """ |
| 136 | with OctFilter(order=4, nthOct=nthOct, minFreq=minFreq, maxFreq=maxFreq, |
| 137 | base=10, refFreq=1000, samplingRate=signal.samplingRate) as ofb: |
| 138 | fsignal = ofb.filter(signal) |
| 139 | out = [] |
| 140 | for filtsignal in fsignal: |
| 141 | out.append(Analysis('L', nthOct, minFreq, maxFreq, filtsignal.spl())) |
| 142 | return out if len(out) > 1 else out[0] |
| 143 | |
| 144 | |
| 145 | def merge(signal1, *signalObjects): |