Saving filter coefficients from the Filter Visualization tool
조회 수: 7 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2023년 5월 4일
답변: MathWorks Support Team
2023년 5월 4일
I have opened a filter in the Filter Visualization tool. I can view the filter coefficients but am not able to save the coefficients to a file. How can I accomplish this workflow in R2023a?
채택된 답변
MathWorks Support Team
2023년 5월 4일
As of R2023a, the Filter Visualization tool does not directly support exporting the filter coefficients.
As a workaround, you can use the ‘coeffs’ function to store the coefficients to a workspace variable and then use the ‘writematrix’ function to write the stored coefficients to a file.
As an example, suppose you want to save the coefficients of the shipped filter 'dsp.CICCompensationInterpolator'. The filter coefficients can then be saved to a file using following code snippet:
storedCoefficients = coeffs(dsp.CICCompensationInterpolator); %extract the filter coefficients as structure
writematrix(storedCoefficients.Numerator,'CoefficientData.txt'); %save the numerator coefficients to a text file
This code snippet will save the filter coefficients in a text file ‘CoefficientData.txt’ (you can choose any file formats as per your requirement). Please refer to the following documentation on ‘writematrix’ function for more information:
For more information on the ‘coeffs’ function, please refer to the following documentation:
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Filter Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!