Using DSB-SC for a wav file.

조회 수: 4 (최근 30일)
Panagiotis Chatzilabrou
Panagiotis Chatzilabrou 2019년 5월 28일
댓글: Star Strider 2020년 10월 11일
Hello everyone..!!
I have a assignment to do for my lab which is about to remove the noise from a wav file. I did try the type that the teacher gave us but it doesnt seem to work. can anyone help me ?
clear all;
close all;
[data,fs] = audioread ('mixed.wav');
fc=13; %% hz
t=1:2; %% time
u=3*pi/2; %% phase
m = data * cos(2*pi*fc*t+u);
sound (m,fs);

채택된 답변

Star Strider
Star Strider 2019년 5월 28일
If you intend to create a double sideband -suppressed carrier signal, you need to use element-wise multiplication:
m = data .* cos(2*pi*fc*t+u);
Of course the two vectors must have the same sizes, or the operation will throw an error to that effect.
See the documentation section on Array vs. Matrix Operations (link) for details.
  댓글 수: 4
Rhyston Da Silva
Rhyston Da Silva 2020년 10월 11일
I am trying to create a SSB-SC modulation of an audio file input can someone tell me if what I have done is correct?
[sound1,fs]=audioread('sound1.wav');
Sampling_Frequency2=fs
fc=fs/2;
freqdev=100;
dt=1/fs;
len=length(sound1)*dt;
t=0:dt:len;
t=t(1:end-1);
m=sound1.*cos(2*pi*fc*fs);
FFTm=fft(m,length(m));
plot(abs(FFTm))
Star Strider
Star Strider 2020년 10월 11일
Rhyston Da Silva —
I believe you are defining the carrier as:
cos(2*pi*fc*fs)
If so, note that multiplying ‘fc’ by ‘t’ (rather than ‘fs’) will most likely do what you want. As currently written, the carrier is a scalar. This is unlikely to produce an actual carrier, since the carrier should be the same size as the modulating signal, and the carrier frequency is usually much higher than the frequency of the modulating signal. The iidea is to get the baseband signal to the frequency of the carrier so it can be transmitted efficiently.
Also, the length of the fft output will be the length of the time-domain signal (unless otherwise specified), so specifying that to be the same length as the time-domain signal in the fft call is not necessary. Dividing the fft result by the length of the time-domain signal will scale it to produce the approximate half-amplitude of the argument amplitude. Otherwise, the amplitude will be significantly greater than actual amplitude.
The plot will be the amplitude of the two-sided Fourier transform. If you want to do that, consider using the fftshift function, and creating an appropriate frequency vector (from -Fs/2 to +Fs/2, where ‘Fs’ is the sampling frequency of the carrier signal) to plot it against.
This should probably be a new Question, so I will not respond further to it here.

댓글을 달려면 로그인하십시오.

추가 답변 (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