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!

采纳的回答

David K.
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 个评论
Vlad Paul
Vlad Paul 2019-7-17
Thank you for the answer. I was thinking about using different for loops, but I know it will take a lot of time. I was thinking of using functions like fminsearch etc., but I am struggling with adapting that function to my need
David K.
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 CenterFile Exchange 中查找有关 Multirate Signal Processing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by