Using DSB-SC for a wav file.
7 次查看(过去 30 天)
显示 更早的评论
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);
0 个评论
采纳的回答
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.
4 个评论
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
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 Center 和 File Exchange 中查找有关 Modulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!