Memuat
Memuat
Support Vector Machine (fitcsvm) for Acoustics and Audio
0 views
Train an SVM to separate classes in environmental sound types from spectral features and assess accuracy with cross-validation. fitcsvm trains a Support Vector Machine for binary classification with various kernels. It suits classification on small to medium data with complex class boundaries.

Train an SVM to separate classes in environmental sound types from spectral features and assess accuracy with cross-validation.
| Role | Variable | Unit |
|---|---|---|
| Main | Sound class | - |
| Supporting 1 | Spectral centroid | Hz |
| Supporting 2 | Zero-crossing rate | 1/detik |
The RBF-kernel SVM classifies Sound class with a test accuracy of 0.893 and F1 of 0.901 using 84 support vectors; the best cross-validated accuracy of 0.934 occurs at C=31.62.
Computed from illustrative synthetic data, not from a real study.
fitcsvm trains a Support Vector Machine for binary classification with various kernels. It suits classification on small to medium data with complex class boundaries.
Report the kernel, hyperparameters, test metrics, and the number of support vectors. Acknowledge the limited interpretability of a black-box model.
A short starting script with this project's variable names. The delivered version is adapted to your data and fully commented.
rng(6);
n = 300;
spectral_centroid = randn(n, 2);
sound_class = double(sum(spectral_centroid.^2, 2) > 1.4); % circular class boundary
cv = cvpartition(sound_class, 'HoldOut', 0.25);
Xtr = spectral_centroid(training(cv), :); ytr = sound_class(training(cv));
Xte = spectral_centroid(test(cv), :); yte = sound_class(test(cv));
best = inf;
for C = [0.1 1 10 100]
m = fitcsvm(Xtr, ytr, 'KernelFunction', 'rbf', 'KernelScale', 'auto', ...
'BoxConstraint', C, 'Standardize', true);
err = kfoldLoss(crossval(m, 'KFold', 5));
if err < best, best = err; Cbest = C; end
end
mdl = fitcsvm(Xtr, ytr, 'KernelFunction', 'rbf', 'KernelScale', 'auto', ...
'BoxConstraint', Cbest, 'Standardize', true);
[pred, score] = predict(mdl, Xte);
[~, ~, ~, auc] = perfcurve(yte, score(:, 2), 1);
fprintf('Best C = %g, CV error = %.3f\n', Cbest, best);
fprintf('Test accuracy = %.3f, AUC = %.3f, support vectors = %d\n', mean(pred == yte), auc, sum(mdl.IsSupportVector));
disp(confusionmat(yte, pred));
[g1, g2] = meshgrid(linspace(-3, 3, 150));
gp = predict(mdl, [g1(:) g2(:)]);
figure; gscatter(g1(:), g2(:), gp, [0.9 0.9 1; 1 0.9 0.9]); hold on;
gscatter(Xte(:,1), Xte(:,2), yte, 'br', 'ox');
xlabel('x_1'); ylabel('x_2'); title('SVM decision regions');Choose how much help you need. Each higher package includes everything in the lower ones. Prices exclude 11% VAT.
Package 1
US$25
excl. 11% VAT
Duration: 5 working days
Output: MATLAB files + result figures
Deliverables
Package 2 · most chosen
US$69
excl. 11% VAT
Duration: 9 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$150
excl. 11% VAT
Duration: 14-17 working days
Output: Code + analysis + guidance until ready to present
Includes all of Packages 1 & 2, plus
Yes. Support Vector Machine (fitcsvm) is commonly used at this level in Acoustics and Audio. We adapt the analysis to your research question, your own data and your supervisor's requirements.
No. The sheet is computed from illustrative synthetic data so you can see the kind of output MATLAB gives. For your order we run the same method on your own data.
That is the point of the packages. Every script is commented, and Package 3 includes two coaching sessions plus practice questions so you can explain the method and the results at your seminar and defence.
Each project has three packages: Package 1 (code and explanation) US$25, Package 2 (your data analysis and interpretation) US$69 and Package 3 (full guidance) US$150, excluding 11% VAT. Larger datasets, extra methods or tight deadlines adjust the quote after a short consultation.
The result sheet uses illustrative synthetic data. MATLAB is a trademark of The MathWorks, Inc.
Back to MATLAB portfolio