[Python] How to calculate SQNR?

Discussão em 'Python' iniciado por Stack, Março 2, 2025.

  1. Stack

    Stack Membro Participativo

    The formula for SQNR (Signal-to-Quantization-Noise Ratio) is: 10*log10(fp^2/(fp-FP)^2))

    fp represents the floating-point (original) signal.

    FP represents the quantized (fixed-point) signal.

    I don't know which one corresponds correctly in the code

    print(fp .shape) #(100,300,125)
    print(FP.shape) #(100,300,125)
    for i in range(100) :
    #1. SQNR = 10 * math.log10(((fp**2).sum())/((fp-FP)**2).sum())
    #2. SQNR = 10 * math.log10(((np.mean(fp)**2))/(np.mean(fp-FP)**2))
    #3. SQNR = 10 * math.log10(np.mean(fp**2)/(np.mean(fp-FP)**2))

    print(np.mean(SQNR))

    Continue reading...

Compartilhe esta Página