Newbie: How to create a low pass that can be exported into c++?
5 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I am a c++ developer and COMPLETELY new to matlab. I read that matlab can help me with low pass filtering a signal. my signal has a x and y int16 component and in my c++ application one can change sample rate and cutoff frequency. I have watched a tutorial and read some posts, i.e. http://www.mathworks.com/matlabcentral/answers/37975-how-to-design-an-iir-low-pass-filter-with-matlab but I am still stuck.
my goal is to have a c++ function that i can just pass my signal data to on the fly, the signal is not prerecorded. so i was thinking one could initialize a butterworth low pass with sample rate and cutoff frequency like: fdesign.lowpass('N,F3db', 3, 0.5, 2000); and then continuously run the incoming data through the filter. when the user changes the cutoff frequency the filter would be reinitialized.
i know how to create c++ code from a matlab project, but can someone point me in the right direction how the matlab functions should look like?
thanx!!
0 个评论
回答(2 个)
Wayne King
2012-7-28
Which MathWorks' products do you have? If you have MATLAB Coder, the Signal Processing Toolbox, and the DSP System Toolbox, you can easily write a filter design and implementation routine in MATLAB that you can port directly to C/C++ code with codegen
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 C Code Generation 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!