Digital audio signal processing project in Python or Matlab.

Thread Starter

wilalt9159

Joined Jun 23, 2020
6
Digital signal processing project using a stress frequency (2500hz) and also a cure (432hz). Confirm this with songs of your choice. Well, once the spectrum of the signals has been determined and the frequencies confirmed, in each song, it designs digital filters, rejects band and passes band. and show the spectra in your work, and at least one song with a filter and without filters. Why bandwidth and reject band ?, bandwidth so that you can listen to the music only with frequencies close to the frequency of healing or stress and then reject the band to listen to the music without the frequency of stress or healing. It would be great if the programs are in Python, if not, do it in MATLAB.

I need help to set up this processing job.
 

KeithWalker

Joined Jul 10, 2017
1,062
I specialized in digital signal analysis and have a lot of experience using Agilent Vee-Pro. Why would you want to take take so much time and effort to distort an artist's music? You can achieve those results using an inexpensive audio equalizer. If you really want music to fit the parameters you mention, it would be much easier to produce it electronically rather than alter the work of someone else.
Regards,
Keith
 

Thread Starter

wilalt9159

Joined Jun 23, 2020
6
this would be a college job, where you have to make filters as mentioned, using any song, but having to use the frequency of healing in a song and the frequency of stress also with a song, having to put together a program in matlab or python , showing the spectrum of the signals of each frequency with the music.
 

bogosort

Joined Sep 24, 2011
465
It seems that the project is asking you to design four filters: two bandpass filters -- one centered at 2.5 kHz, the other at 432 Hz -- and two notch filters (band reject) centered at the same two frequencies. It seems that you're supposed to choose a piece of music and compare your "mood" when listening with and without the band reject filters. Presumably, you then listen to the bandpass versions to help qualify what you experienced.

As an experiment on the effects of frequencies on mood, it's a terrible experiment. Fortunately, I don't think that's the point of the project, which is to get you to design filters and quantitatively compare the resulting spectra.

So, the first step is designing the filters. Using what you've learned so far, you should think about how wide or narrow the bandwidth of each filter should be, and what kind of response you want (Butterworth, Chebyshev, etc.). I'd recommend doing everything in MATLAB, especially if you're allowed to use a filter design tool. If you need to calculate the filter coefficients by hand, find out if there is a minimum order requirement.
 

Thread Starter

wilalt9159

Joined Jun 23, 2020
6
It seems that the project is asking you to design four filters: two bandpass filters -- one centered at 2.5 kHz, the other at 432 Hz -- and two notch filters (band reject) centered at the same two frequencies. It seems that you're supposed to choose a piece of music and compare your "mood" when listening with and without the band reject filters. Presumably, you then listen to the bandpass versions to help qualify what you experienced.

As an experiment on the effects of frequencies on mood, it's a terrible experiment. Fortunately, I don't think that's the point of the project, which is to get you to design filters and quantitatively compare the resulting spectra.

So, the first step is designing the filters. Using what you've learned so far, you should think about how wide or narrow the bandwidth of each filter should be, and what kind of response you want (Butterworth, Chebyshev, etc.). I'd recommend doing everything in MATLAB, especially if you're allowed to use a filter design tool. If you need to calculate the filter coefficients by hand, find out if there is a minimum order requirement.
you can help set up this project, I am not able to start, it can be in matlab.
 

Papabravo

Joined Feb 24, 2006
13,968
you can help set up this project, I am not able to start, it can be in matlab.
So do you even have to know how to design filters to do this? Were you planning on spending any time or effort on this part? Can you just have somebody else do the heavy lifting while you get the credit?
 

Thread Starter

wilalt9159

Joined Jun 23, 2020
6
[CITAÇÃO = "Papabravo, post: 1525560, membro: 5202"]
Então você precisa saber como projetar filtros para fazer isso? Você estava planejando gastar algum tempo ou esforço nessa parte? Você pode mandar alguém fazer o trabalho pesado enquanto recebe o crédito?
[/CITAR]
Não toquei nos filtros por um longo tempo, não quero receber crédito de outras pessoas, publicarei os filtros que fiz, então gostaria que alguém ajudasse a verificar e melhorar o projeto.
 

Thread Starter

wilalt9159

Joined Jun 23, 2020
6
% Filtering of signals with digital filters.
% Reading the file
[Y, fs, n] = wavread ('C: \ Blanca \ pds2018 \ handel.wav');
% Design of digital filters
% Obtaining and graphing the coefficients of different filters and their representation in the
% frequency domain.
% filter order 201
M = input ('enter the filter order, odd number')
number = input ('enter number 0 if the filters are fpb, fpae 1 secfpaban, frban')
if number == 0
disp ('low pass filter')
% calculation of coefficients
wc = input ('enter the cutoff frequency')
n = - (M-1) / 2: 1: (M-1) / 2;
% Low pass filter for
lpn = sin (wc * n) ./ (pi * n);
lpn ((M-1) / 2 +1) = wc / pi;
figure (1), stem (n, lpn)
figure (2), freqz (lpn)
% High pass filter
lhp = -lpn
lhp ((M-1) / 2 +1) = 1-lpn ((M-1) / 2 +1)
figure (3), stem (n, lhp)
figure (4), freqz (lhp)
else
n = - (M-1) / 2: 1: (M-1) / 2;
disp ('Filtro passa-banda')
wc1 = entrada ('insira a frequência wc1')
wc2 = entrada ('insira frequência wc2')
lbp = (sin (wc2 * n) -sin (wc1 * n)) ./ (pi * n)
lbp ((M-1) / 2 +1) = (wc2-wc1) / pi;
figura (1), haste (n, lbp)
figura (2), freqz (lbp)
disp ('Filtro de rejeição de banda')
lbr = -lbp
lbr ((M-1) / 2 +1) = 1-lbp ((M-1) / 2 +1)
figura (3), caule (n, lbr)
figura (4), freqz (lbr)
fim
% Sinal filtrado
y2 = filtro (lpn, 1, Y);
som (Y, fs)
pausa
som (y2, fs)

% Espectro de sinal
T = 1 / fs; % Tempo da amostra
L = comprimento (Y); % Comprimento do sinal
t = (0: L-1) * T; % Vetor de tempo

NFFT = 2 ^ nextpow2 (L); % Próxima potência de 2 do comprimento de y
Y1 = fft (Y, NFFT) / L;
f = fs / 2 * espaço interior (0,1, NFFT / 2 + 1);
figura (5)
% Gráfico do espectro de amplitude.
plot (f, 2 * abs (Y1 (1: NFFT / 2 + 1))))
title ('Espectro de amplitude de um lado de y (t)')
xlabel ('Frequência (Hz)')
rótulo ('| Y (f) |')
aguente
Y2 = fft (y2, NFFT) / L;
f = fs / 2 * espaço interior (0,1, NFFT / 2 + 1);
figura (6)
% Gráfico do espectro de amplitude.
plot (f, 2 * abs (Y2 (1: NFFT / 2 + 1))))
 

Thread Starter

wilalt9159

Joined Jun 23, 2020
6
% Filtering of signals with digital filters.
% Reading the file
[Y, fs, n] = wavread ('C: \ Blanca \ pds2018 \ handel.wav');
% Design of digital filters
% Obtaining and graphing the coefficients of different filters and their representation in the
% frequency domain.
% filter order 201
M = input ('enter the filter order, odd number')
number = input ('enter number 0 if the filters are fpb, fpae 1 secfpaban, frban')
if number == 0
disp ('low pass filter')
% calculation of coefficients
wc = input ('enter the cutoff frequency')
n = - (M-1) / 2: 1: (M-1) / 2;
% Low pass filter for
lpn = sin (wc * n) ./ (pi * n);
lpn ((M-1) / 2 +1) = wc / pi;
figure (1), stem (n, lpn)
figure (2), freqz (lpn)
% High pass filter
lhp = -lpn
lhp ((M-1) / 2 +1) = 1-lpn ((M-1) / 2 +1)
figure (3), stem (n, lhp)
figure (4), freqz (lhp)
else
n = - (M-1) / 2: 1: (M-1) / 2;
disp ('Bandpass filter')
wc1 = input ('enter the frequency wc1')
wc2 = input ('enter the frequency wc2')
lbp = (sin (wc2 * n) -sin (wc1 * n)) ./ (pi * n)
lbp ((M-1) / 2 +1) = (wc2-wc1) / pi;
figura (1), haste (n, lbp)
figura (2), freqz (lbp)
disp ('Band rejection filter')
lbr = -lbp
lbr ((M-1) / 2 +1) = 1-lbp ((M-1) / 2 +1)
figura (3), caule (n, lbr)
figura (4), freqz (lbr)
fim
% Filtered signal
y2 = filtro (lpn, 1, Y);
som (Y, fs)
break
sound (y2, fs)

% Signal spectrum
T = 1 / fs; % sample time
L = comprimento (Y); % Signal length
t = (0: L-1) * T; % time vector

NFFT = 2 ^ nextpow2 (L); %Next power of 2 of y length
Y1 = fft (Y, NFFT) / L;
f = fs / 2 * interior space (0,1, NFFT / 2 + 1);
figura (5)
% Amplitude spectrum graph.
plot (f, 2 * abs (Y1 (1: NFFT / 2 + 1))))
title ('Amplitude spectrum on one side of y (t)')
xlabel ('Frequêncy (Hz)')
rótulo ('| Y (f) |')
aguente
Y2 = fft (y2, NFFT) / L;
f = fs / 2 * interior space (0,1, NFFT / 2 + 1);
figure (6)
% Amplitude spectrum graph.
plot (f, 2 * abs (Y2 (1: NFFT / 2 + 1))))
 
Top