Set signal level to -3dB

I have a sound, and from that sound a get a signal form and spectrum and i need to set this sound signal level to -3dB how to do that.
if true
% code
endclear all; close all; clc %
[y,Fs] = audioread('Kulka.wav');
s = y(:,1);
N = length(s);
n = 1:N ; % imtis
S=fft(s); % signalo FFT
Faxis=(n-1)*Fs/N; % dazniu asis
Sa = abs(S)/(N/2); % amplitude
figure(1) % FFT atvaizdavimas
plot(Faxis, Sa)
xlabel('Daznis, Hz');
ylabel('Amplitude, V');
title('FFT');
xlim ([0 Fs/2]); grid on
nfft = 1024; % spektrogramos pradzia
window = nfft;
noverlap = window-10;
sound(s,44100); %garso atkurimas
figure(2) % Spektrogamos atvaizdavimas
specgram(s,nfft,Fs,window,noverlap) % Spektrograma
xlabel('Laikas, s');
ylabel('Daznis, Hz');
title('Spektrograma');

Answers (0)

Asked:

on 9 Apr 2015

Community Treasure Hunt

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

Start Hunting!