function classify_signal(numTests)
    % Parameters
    n = 100; % Number of bits
    f1 = 1;  % Frequency for ASK and FSK
    f2 = 2;  % Secondary frequency for FSK
    snr = 100; % Signal-to-Noise Ratio

    % Variables to track performance
    correctClassification = 0;

    % Run the test cases
    for test = 1:numTests
        % Randomly generate a modulation type: 1 = ASK, 2 = FSK, 3 = PSK
        trueModType = randi([1, 3]);

        % Generate the signal accordingly
        [ask, fsk, psk] = generate_modulated_signals(n, f1, f2);
        
        % Add noise based on selected modulation type
        switch trueModType
            case 1
                received_signal = awgn(ask, snr, 'measured');
            case 2
                received_signal = awgn(fsk, snr, 'measured');
            case 3
                received_signal = awgn(psk, snr, 'measured');
        end

        % Classify the received signal
        detectedModType = classify_modulation(received_signal, f1, f2, snr);

        % Convert detected modulation to numerical form to compare
        switch detectedModType
            case 'ASK'
                detectedNum = 1;
            case 'FSK'
                detectedNum = 2;
            case 'PSK'
                detectedNum = 3;
        end

        % Check if classification was correct
        if trueModType == detectedNum
            correctClassification = correctClassification + 1;
        end

        % Display result for each test
        fprintf('Test %d | True: %s | Detected: %s\n', test,modTypeToString(trueModType), detectedModType);
    end

    % Calculate and display the accuracy
    accuracy = (correctClassification / numTests) * 100;
    fprintf('Classification accuracy: %.2f%%\n', accuracy);
end

% Helper Functions

function typeStr = modTypeToString(typeNum)
    switch typeNum
        case 1
            typeStr = 'ASK';
        case 2
            typeStr = 'FSK';
        case 3
            typeStr = 'PSK';
    end
end

function [ask, fsk, psk] = generate_modulated_signals(n, f1, f2)
    t = 0:1/30:1-1/30;
    b = randi([0, 1], 1, n);

    % ASK
    sa1 = sin(2 * pi * f1 * t) / sqrt(sum(sin(2 * pi * f1 * t).^2));
    sa0 = zeros(size(sa1));
    
    % FSK
    sf0 = sin(2 * pi * f1 * t) / sqrt(sum(sin(2 * pi * f1 * t).^2));
    sf1 = sin(2 * pi * f2 * t) / sqrt(sum(sin(2 * pi * f2 * t).^2));
    
    % PSK
    sp0 = -sa1;
    sp1 = sa1;

    % Modulate
    ask = [];
    fsk = [];
    psk = [];
    for i = 1:n
        if b(i) == 1
            ask = [ask, sa1];
            fsk = [fsk, sf1];
            psk = [psk, sp1];
        else
            ask = [ask, sa0];
            fsk = [fsk, sf0];
            psk = [psk, sp0];
        end
    end
end

function mod_type = classify_modulation(signal, f1, f2, snr)
    % Use Fourier Transform to analyze frequency characteristics
    N = length(signal);
    spectrum = abs(fft(signal));
    freq = (0:N-1)*(30/N); % Frequency range

    % Identify the main frequency components
    [~, locs] = findpeaks(spectrum, 'MinPeakDistance', 5);

    % Conditions for classification based on frequency peaks
    f1_band = freq(locs) > f1-0.2 & freq(locs) < f1+0.2;
    f2_band = freq(locs) > f2-0.2 & freq(locs) < f2+0.2;
    
    % Logical array indicating presence of peaks in different bands
    has_f1 = any(f1_band);
    has_f2 = any(f2_band);
    
    % Assume ASK, FSK, PSK based on presence of frequency components
    if has_f1 && ~has_f2
        mod_type = 'ASK';
    elseif has_f1 && has_f2
        mod_type = 'FSK';
    else
        mod_type = 'PSK';
    end
end
Just give me the plots from where i can decide the thresholds for myself