31 lines
456 B
Plaintext
31 lines
456 B
Plaintext
|
|
[x, Fs] = audioread('wannabe_in_la.wav');
|
|
|
|
len = length(x) / Fs % opd A
|
|
|
|
% opd B
|
|
ft_x = fft(x);
|
|
df = Fs / length(ft_x);
|
|
f = (0 : length(ft_x) - 1) .* df;
|
|
% plot(f, 20 * log10(abs(ft_x)))
|
|
% xlabel('f (Hz)')
|
|
% ylabel('|X| (dB)')
|
|
% title('Frequentiespectrum |X(f)|')
|
|
% grid
|
|
|
|
Fc = 300;
|
|
p = Fs/(2*Fc) % opd C
|
|
|
|
k = 10; % opd D
|
|
n = -k:k;
|
|
b = sin(pi * n / p) ./ (pi * n) ;
|
|
b(n == 0) = 1 / p;
|
|
|
|
freqz(b, 1, 0:(Fs/2), Fs);
|
|
|
|
tic;
|
|
y = conv(b, x);
|
|
toc;
|
|
|
|
|
|
soundsc(y, Fs) |