Plots the signal decibel magnitude in frequency domain. xLabel, yLabel, and title are saved for the next plots when provided. Parameters (default), (type): ----------------------------- * smooth (False), (bool): option for curve smoothing. Uses
(self, smooth:bool=False, xLabel:str=None, yLabel:str=None,
yLim:list=None, xLim:list=None, title:str=None,
decimalSep:str=',')
| 668 | return fig |
| 669 | |
| 670 | def plot_freq(self, smooth:bool=False, xLabel:str=None, yLabel:str=None, |
| 671 | yLim:list=None, xLim:list=None, title:str=None, |
| 672 | decimalSep:str=','): |
| 673 | """Plots the signal decibel magnitude in frequency domain. |
| 674 | |
| 675 | xLabel, yLabel, and title are saved for the next plots when provided. |
| 676 | |
| 677 | Parameters (default), (type): |
| 678 | ----------------------------- |
| 679 | |
| 680 | * smooth (False), (bool): |
| 681 | option for curve smoothing. Uses scipy.signal.savgol_filter. |
| 682 | Preliminar implementation. Needs review. |
| 683 | |
| 684 | * xLabel ('Time [s]'), (str): |
| 685 | x axis label. |
| 686 | |
| 687 | * yLabel ('Amplitude'), (str): |
| 688 | y axis label. |
| 689 | |
| 690 | * yLim (), (list): |
| 691 | inferior and superior limits. |
| 692 | |
| 693 | >>> yLim = [-100, 100] |
| 694 | |
| 695 | * xLim (), (list): |
| 696 | left and right limits |
| 697 | |
| 698 | >>> xLim = [15, 21000] |
| 699 | |
| 700 | * title (), (str): |
| 701 | plot title |
| 702 | |
| 703 | * decimalSep (','), (str): |
| 704 | may be dot or comma. |
| 705 | |
| 706 | >>> decimalSep = ',' # in Brazil |
| 707 | |
| 708 | Return: |
| 709 | -------- |
| 710 | |
| 711 | matplotlib.figure.Figure object. |
| 712 | """ |
| 713 | if xLabel is not None: |
| 714 | self.freqXLabel = xLabel |
| 715 | else: |
| 716 | if hasattr(self, 'freqXLabel'): |
| 717 | if self.freqXLabel is not None: |
| 718 | xLabel = self.freqXLabel |
| 719 | |
| 720 | if yLabel is not None: |
| 721 | self.freqYLabel = yLabel |
| 722 | else: |
| 723 | if hasattr(self, 'freqYLabel'): |
| 724 | if self.freqYLabel is not None: |
| 725 | yLabel = self.freqYLabel |
| 726 | |
| 727 | if title is not None: |
no outgoing calls
no test coverage detected