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
1 件のコメント
Rena Berman
2020 年 1 月 16 日
(Answers Dev) Restored edit
回答 (1 件)
Image Analyst
2019 年 12 月 24 日
0 投票
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 件のコメント
Mustafa Andac Ust
2019 年 12 月 24 日
編集済み: Image Analyst
2019 年 12 月 24 日
Image Analyst
2019 年 12 月 24 日
編集済み: Image Analyst
2019 年 12 月 26 日
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().

カテゴリ
ヘルプ センター および File Exchange で Measurements and Spatial Audio についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!