Calculates the mean reverberation time of the reverberation chamber; Parameters (default), (type): ----------------------------- * roomirsGetDict (), (): a dict from the roomir.MeasurementData.get method containing MeasuredThings
(self, roomirsGetDict, IREndManualCut=None, T=20)
| 2605 | return G |
| 2606 | |
| 2607 | def G_T_revCh(self, roomirsGetDict, IREndManualCut=None, T=20): |
| 2608 | """ |
| 2609 | Calculates the mean reverberation time of the reverberation chamber; |
| 2610 | |
| 2611 | Parameters (default), (type): |
| 2612 | ----------------------------- |
| 2613 | |
| 2614 | * roomirsGetDict (), (): |
| 2615 | a dict from the roomir.MeasurementData.get method containing |
| 2616 | MeasuredThings of the type 'roomir' (room impulsive response); |
| 2617 | |
| 2618 | * IREndManualCut (None), (float): |
| 2619 | remove the end of the impulsive response from IREndManualCut, |
| 2620 | given in seconds; |
| 2621 | |
| 2622 | Return (type): |
| 2623 | -------------- |
| 2624 | |
| 2625 | * T_revCh (Analysis): |
| 2626 | an Analysis with the mean reverberation time calculated from |
| 2627 | all the reverberation chamber's impulsive responses; |
| 2628 | |
| 2629 | """ |
| 2630 | # Code snippet to guarantee that generated object name is |
| 2631 | # the declared at global scope |
| 2632 | # for frame, line in traceback.walk_stack(None): |
| 2633 | for framenline in traceback.walk_stack(None): |
| 2634 | # varnames = frame.f_code.co_varnames |
| 2635 | varnames = framenline[0].f_code.co_varnames |
| 2636 | if varnames == (): |
| 2637 | break |
| 2638 | # creation_file, creation_line, creation_function, \ |
| 2639 | # creation_text = \ |
| 2640 | extracted_text = \ |
| 2641 | traceback.extract_stack(framenline[0], 1)[0] |
| 2642 | # traceback.extract_stack(frame, 1)[0] |
| 2643 | # creation_name = creation_text.split("=")[0].strip() |
| 2644 | creation_name = extracted_text[3].split("=")[0].strip() |
| 2645 | |
| 2646 | roomirs = roomirsGetDict |
| 2647 | RTs = [] |
| 2648 | for msdThngName, msdThng in roomirs.items(): |
| 2649 | print("Calculating RTs for {}".format(msdThngName)) |
| 2650 | for idx, avg in enumerate(msdThng.measuredSignals): |
| 2651 | print("Calculating average {}".format(idx)) |
| 2652 | sigObj = avg.systemSignal |
| 2653 | TR = rooms.analyse(sigObj, 'RT', T, nthOct=self.nthOct, |
| 2654 | minFreq=self.minFreq, |
| 2655 | maxFreq=self.maxFreq, |
| 2656 | plotLundebyResults=False, |
| 2657 | IREndManualCut=IREndManualCut) |
| 2658 | RTs.append(TR) |
| 2659 | # Averaging in space |
| 2660 | bands = RTs[0].bands |
| 2661 | spacialAvgdRT = [] |
| 2662 | for bandIdx, _ in enumerate(bands): |
| 2663 | bandRTsum = 0 |
| 2664 | bandRTcount = 0 |