I am trying to convert MatLab's pitch method to C using the MatLab Coder app, but I am running into an error I do not understand. I am trying to convert this method to C for use in a real-time pitch shifter program that will work much better in C than it does in MatLab. I'm using the pitch method in the main script for the pitch-shifter. Here is how I am trying to convert the pitch method to C so far:
I open the Coder app and input the following script to auto-define the variable types of the pitch method. In this example, mySignal is a 1024x1 double.
pitch(mySignal, 1852.2, 'NumChannels', size(1024, 2), 'SamplesPerChannel', size(1024, 1), 'Range', [50,400], 'WindowLength', round(1852.2 * 0.052), 'OverlapLength', round(1852.2 * 0.042), 'Method', 'NCF', 'MedianFilterLength', 1);
I then get the following auto-defined variable definitions:
From here, I attempt to run the MEX test generator to detect errors. The following image details the error I receive:
There is some issue with my auto-defined variables and the MatLab setProperties() method:
Any help you can give on this, I greatly appreciate. I need this for a school project in less than a month and I am just at a loss for what the problem is. The method should be able to be converted, as it contains the C Generation tag on its MatLab documentation page. Thank you for your help, please let me know if you need any clarification.