Can Someone Help me ?

The majority of the power spectrum of human voice is concentrated in the frequency band from 0 to 4 kHz. One way of scrambling this frequency band is to subdivide it into 4 equal sub-bands and interchange the sub-bands according to some pre-determined key. For example, let sub-band A correspond to frequencies between 0 and 1 kHz. Then, sub-band B corresponds to frequencies between 1 and 2 kHz, sub-band C corresponds to frequencies 2 and 3 kHz, and sub-band D corresponds to frequencies between 3 and 4 kHz. The original order of the subbands is ABCD. A simple scrambling technique is to interchange the order, that is reorder the sub-bands to BCDA or DCBA or CABD or any other pre-determined order. The resulting signal is the scrambled signal. This scrambled signal is not comprehensible unless you know the key and can rearrange the sub-bands back into the original order. You are going to write a MATLAB program that will descramble a given voice signal. You may download the scrambled signal “scramble.wav” from the Blackboard website of the course. This voice signal has been scrambled by rearranging the bands ABCD into CBDA. The MATLAB code you’re going to write should descramble this signal. Hint: First use the audioread function to read the data from the “scramble.wav” file and then apply DFT to the time domain samples using the fft function. Once you have the DFT of the samples, you must implement the descrambling scheme described above, CBDA → ABCD. Finally in order to get the time domain samples, use ifft that is the inverse DFT and take its real part. You can play the descrambled voice signal by using the sound function and transcribe the words
it is a Code
filename = 'scramble.wav';
[Y,fs] = audioread('scramble.wav');
function [recov,fs,nbits] = Untitled3(filename);
[orig,fs,nbits] = wavread(filename); origfft = fft(orig);
%CBDA
%||||
%ABCD
if rem(length(origfft),2), highf = (length(origfft)+1)/2;
C = origfft(2:floor(highf/4));
B = origfft(floor(highf/4)+1:floor(highf/2));
D = origfft(floor(highf/2)+1:floor(highf*0.75));
A = origfft(floor(highf*0.75)+1:highf);
recov = [origfft(1);A;B;C;D;flipud([conj(A);conj(B);conj(C);conj(D)])];
else
highf = length(origfft)/2 + 1;
C = origfft(2:floor(highf/4));
B = origfft(floor(highf/4)+1:floor(highf/2));
D = origfft(floor(highf/2)+1:floor(highf*0.75));
A = origfft(floor(highf*0.75)+1:highf-1);
recov = [origfft(1);A;B;C;D;origfft(highf); flipud([conj(A);conj(B);conj(C);conj(D)])];
recov = real(ifft(recov));
end
end
>> Untitled3
Error: File: Untitled3.m Line: 5 Column: 29
Function with duplicate name "Untitled3" cannot be defined.
it is my screen : https://i.hizliresim.com/bvmQLd.jpg
it is not working

Respuestas (1)

Image Analyst
Image Analyst el 24 de Dic. de 2019

0 votos

You cannot have a function called untitled3 inside a script/function combination m-file of the same name. Call the file question3.m or something. Or else call the function inside the m-file something different.

2 comentarios

Mustafa Andac Ust
Mustafa Andac Ust el 24 de Dic. de 2019
Editada: Image Analyst el 24 de Dic. de 2019
Now it says Function 'abc' might be unused.
And how can I listen to the new audiowav?
varY6v.jpg
Image Analyst
Image Analyst el 24 de Dic. de 2019
Editada: Image Analyst el 26 de Dic. de 2019
You define the function abc(), but you never call it anywhere in the script code above the function definition. So that's what the warning is. It's trying to tell you that you've made a function for no reason - it never gets called by any line of code. Just defining the function does not mean it will get called right when your script ends - you have to explicitly call it.
Try sound() or soundsc().
varY6v.jpg

Iniciar sesión para comentar.

Categorías

Más información sobre Measurements and Spatial Audio en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 24 de Dic. de 2019

Comentada:

el 16 de En. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by