Distortion when hiding a signal inside another signal

조회 수: 4 (최근 30일)
Mohamed Zahran
Mohamed Zahran 2020년 5월 14일
댓글: Mohamed Zahran 2020년 5월 18일
Im trying to hide a signal (hidden signal) inside another signal (main signal), both are sounds. first I applied a low pass filter to each signal, pi/8 for the hidden and pi/4 for the main, and i multiplied the hidden signal with 0.01*cos(2*pi*n/4), after that I add the two signals and i play the sound of the combined signals, the problem is that the total signal has alot of distortion and the main signal is played twice, but it did succeed to hide the other signal, how to I improve my code ?
this is my code:
%%% Data Hiding
[y0,Fs0]= audioread('Main Signal.wav');
y0=y0(:,1);
[y1,Fs1]= audioread('Hidden Signal.wav');
y1=y1(:,1);
T0=length(y0)/Fs0;
T1=length(y1)/Fs1;
t0=-T0/2:(T0/length(y0)):(T0/2-(T0/length(y0)));
t1=-T1/2:(T1/length(y1)):(T1/2-(T1/length(y1)));
w1=pi/8;
h1=(w1/pi)*sinc(w1/pi*t1);
y2=conv(y1,h1);
Y1=fftshift(fft(y2));
wy=(-length(Y1)/2:length(Y1)/2-1)*48000/length(Y1);
y1=ifft(Y1);
t1=-T1/2:(T1/length(y1)):(T1/2-(T1/length(y1)));
y1=y1*0.01.*cos(2*pi*t1/4);
Y1=fftshift(fft(y1));
w0=pi/4;
h0=(w0/pi)*sinc(w0/pi*t0);
y0=conv(y0,h0);
t0=-T0/2:(T0/length(y0)):(T0/2-(T0/length(y0)));
Signal_Total=[y0 zeros(1,length(y1)-length(y0))]+y1;

채택된 답변

Zeyad Nasser
Zeyad Nasser 2020년 5월 18일
خخخخخخخخخخ وربنا صح

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Modulation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by