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!