How can I find the best parameter values to minimize a function
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I have an algorithm that does some source separation and as a performance measurement I implemented a Signal to Noise Ratio. At the beginning of the algorithm I initialize parameters like FFT length, hop size, window type and some other source separation parameters. All these parameters can have different values and the separation depends on these numbers.
Is it possible to define a range/vector of values for each parameter (ex. fftLen=[512 1024 2048], window=[hann blackmann hamming] etc.) and run the algorithm to find the best initialization based on a simple Euclidean distance between optimum SNR and estimated SNR? Even though I found some explanations for other problems, I cannot apply these to my algorithm.
Thank you!
0 个评论
采纳的回答
David K.
2019-7-17
If you do not really care about efficiency and time you can just loop through and try everything yourself.
fftlen = [512 1024 2048];
window = {'','',''};
etc
OutputVals = zeros(totalCombinations)
count = 1;
for fftlen
for window
for etc
OutputVals(count) = Algorithm
end
end
end
Analyze_outputs
In general you want to avoid this sort of thing in Matlab as you can often use multidimensional matrices and such. But with no idea what you are actually doing I just wanted to show the most conceptually simple way.
2 个评论
David K.
2019-7-17
That is a function included in the optimization app which could make using it easier.
However you would need to turn your algorithm into a function (if it isn't already). But the biggest problem is I do not think it can be given inputs in text. For fftlen it would probably give back some random decimal instead of an exponent of 2.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulation, Tuning, and Visualization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!