1
0

demo2.m 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. % Demonstration program of the C-FICA algorithm used with real speech
  2. % signals and real filters
  3. clear all; clc; close all;
  4. % Sources definition fs=20e3
  5. s(1,:)=wavread('speech1');
  6. s(2,:)=wavread('speech2');
  7. % Definition of the filter tensor by using the following data base:
  8. % B. Gardner and K. Martin. Head Related Transfer Functions of a Dummy Head
  9. % http://sound.media.mit.edu/ica-bench/.
  10. A(:,1,:)=hrtf(-10);
  11. A(:,2,:)=hrtf(40);
  12. % Convolutive mixing process
  13. x=conv_mix(A,s);
  14. % C-FICA algorithm (we choose [63000 63500] as an extraction window; we are
  15. % currently working on an automatic choice of this window)
  16. [Sc,sc,Isc]=cfica(x,1e-16,[63000 63500],80,400,'v');
  17. % Computation of the true contributions
  18. xc=contributions(A,s);
  19. % Identification of the source permutations
  20. perm=permutations(xc,sc);
  21. sc=sc(:,perm,:);Isc=Isc(:,perm);
  22. % SIRs computation
  23. SIR1=sir(xc(Isc(1),1,:),sc(Isc(1),1,:))
  24. SIR2=sir(xc(Isc(2),2,:),sc(Isc(2),2,:))
  25. % Plotting of the true (blue) and estimated (red) contributions
  26. figure
  27. hold on
  28. plot(squeeze(xc(Isc(1),1,:)));
  29. plot(squeeze(sc(Isc(1),1,:)),'r');
  30. figure
  31. hold on
  32. plot(squeeze(xc(Isc(2),2,:)));
  33. plot(squeeze(sc(Isc(2),2,:)),'r');